mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.1.1826: tests use hand coded feature and option checks
Problem: Tests use hand coded feature and option checks. Solution: Use the commands from check.vim in more tests.
This commit is contained in:
@@ -22,6 +22,22 @@ func CheckFunction(name)
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for the presence of an Ex command
|
||||||
|
command -nargs=1 CheckCommand call CheckCommand(<f-args>)
|
||||||
|
func CheckCommand(name)
|
||||||
|
if !exists(':' .. a:name)
|
||||||
|
throw 'Skipped: ' .. a:name .. ' command not supported'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for the presence of a shell command
|
||||||
|
command -nargs=1 CheckExecutable call CheckExecutable(<f-args>)
|
||||||
|
func CheckExecutable(name)
|
||||||
|
if !executable(a:name)
|
||||||
|
throw 'Skipped: ' .. a:name .. ' program not executable'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check for running on MS-Windows
|
" Command to check for running on MS-Windows
|
||||||
command CheckMSWindows call CheckMSWindows()
|
command CheckMSWindows call CheckMSWindows()
|
||||||
func CheckMSWindows()
|
func CheckMSWindows()
|
||||||
@@ -30,6 +46,14 @@ func CheckMSWindows()
|
|||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check for NOT running on MS-Windows
|
||||||
|
command CheckNotMSWindows call CheckNotMSWindows()
|
||||||
|
func CheckNotMSWindows()
|
||||||
|
if has('win32')
|
||||||
|
throw 'Skipped: does not work on MS-Windows'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Command to check for running on Unix
|
" Command to check for running on Unix
|
||||||
command CheckUnix call CheckUnix()
|
command CheckUnix call CheckUnix()
|
||||||
func CheckUnix()
|
func CheckUnix()
|
||||||
@@ -54,3 +78,27 @@ func CheckRunVimInTerminal()
|
|||||||
throw 'Skipped: cannot run Vim in a terminal window'
|
throw 'Skipped: cannot run Vim in a terminal window'
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Command to check that we can run the GUI
|
||||||
|
command CheckCanRunGui call CheckCanRunGui()
|
||||||
|
func CheckCanRunGui()
|
||||||
|
if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
|
||||||
|
throw 'Skipped: cannot run start the GUI'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Command to check that we are using the GUI
|
||||||
|
command CheckGui call CheckGui()
|
||||||
|
func CheckGui()
|
||||||
|
if !has('gui_running')
|
||||||
|
throw 'Skipped: only works in the GUI'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Command to check that not currently using the GUI
|
||||||
|
command CheckNotGui call CheckNotGui()
|
||||||
|
func CheckNotGui()
|
||||||
|
if has('gui_running')
|
||||||
|
throw 'Skipped: only works in the terminal'
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
@@ -323,10 +323,6 @@ func RunVimPiped(before, after, arguments, pipecmd)
|
|||||||
return 1
|
return 1
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func CanRunGui()
|
|
||||||
return has('gui') && ($DISPLAY != "" || has('gui_running'))
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func WorkingClipboard()
|
func WorkingClipboard()
|
||||||
if !has('clipboard')
|
if !has('clipboard')
|
||||||
return 0
|
return 0
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
" Test 'autochdir' behavior
|
" Test 'autochdir' behavior
|
||||||
|
|
||||||
if !exists("+autochdir")
|
source check.vim
|
||||||
throw 'Skipped: autochdir feature missing'
|
CheckOption autochdir
|
||||||
endif
|
|
||||||
|
|
||||||
func Test_set_filename()
|
func Test_set_filename()
|
||||||
let cwd = getcwd()
|
let cwd = getcwd()
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
" Tests for autocommands
|
" Tests for autocommands
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func s:cleanup_buffers() abort
|
func s:cleanup_buffers() abort
|
||||||
for bnr in range(1, bufnr('$'))
|
for bnr in range(1, bufnr('$'))
|
||||||
@@ -1861,9 +1862,9 @@ func Test_TextChangedI_with_setline()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_Changed_FirstTime()
|
func Test_Changed_FirstTime()
|
||||||
if !has('terminal') || has('gui_running')
|
CheckFeature terminal
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
" Prepare file for TextChanged event.
|
" Prepare file for TextChanged event.
|
||||||
call writefile([''], 'Xchanged.txt')
|
call writefile([''], 'Xchanged.txt')
|
||||||
let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
|
let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
|
||||||
|
@@ -1,17 +1,12 @@
|
|||||||
" Tests for 'balloonevalterm'.
|
" Tests for 'balloonevalterm'.
|
||||||
" A few tests only work in the terminal.
|
" A few tests only work in the terminal.
|
||||||
|
|
||||||
if has('gui_running')
|
|
||||||
throw 'Skipped: only work in the terminal'
|
|
||||||
endif
|
|
||||||
|
|
||||||
source check.vim
|
source check.vim
|
||||||
|
CheckNotGui
|
||||||
CheckFeature balloon_eval_term
|
CheckFeature balloon_eval_term
|
||||||
|
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
let s:common_script =<< trim [CODE]
|
let s:common_script =<< trim [CODE]
|
||||||
call setline(1, ["one one one", "two tXo two", "three three three"])
|
call setline(1, ["one one one", "two tXo two", "three three three"])
|
||||||
|
@@ -4,9 +4,8 @@
|
|||||||
" while the test is run, the breakindent cacheing gets in its way.
|
" while the test is run, the breakindent cacheing gets in its way.
|
||||||
" It helps to change the tabstop setting and force a redraw (e.g. see
|
" It helps to change the tabstop setting and force a redraw (e.g. see
|
||||||
" Test_breakindent08())
|
" Test_breakindent08())
|
||||||
if !exists('+breakindent')
|
source check.vim
|
||||||
throw 'Skipped: breakindent option not supported'
|
CheckOption breakindent
|
||||||
endif
|
|
||||||
|
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_setbufline_getbufline()
|
func Test_setbufline_getbufline()
|
||||||
new
|
new
|
||||||
@@ -147,9 +148,8 @@ func Test_deletebufline()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_appendbufline_redraw()
|
func Test_appendbufline_redraw()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
new foo
|
new foo
|
||||||
let winnr=bufwinnr('foo')
|
let winnr=bufwinnr('foo')
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
|
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
|
||||||
|
|
||||||
if !has('quickfix')
|
source check.vim
|
||||||
throw 'Skipped: quickfix feature missing'
|
CheckFeature quickfix
|
||||||
endif
|
|
||||||
|
|
||||||
" Create the files used by the tests
|
" Create the files used by the tests
|
||||||
function SetUp()
|
function SetUp()
|
||||||
|
@@ -855,9 +855,8 @@ func Test_pipe_from_buffer_nr()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Run_pipe_through_sort(all, use_buffer)
|
func Run_pipe_through_sort(all, use_buffer)
|
||||||
if !executable('sort')
|
CheckExecutable sort
|
||||||
throw 'Skipped: sort program not found'
|
|
||||||
endif
|
|
||||||
let options = {'out_io': 'buffer', 'out_name': 'sortout'}
|
let options = {'out_io': 'buffer', 'out_name': 'sortout'}
|
||||||
if a:use_buffer
|
if a:use_buffer
|
||||||
split sortin
|
split sortin
|
||||||
@@ -1014,9 +1013,8 @@ func Test_pipe_io_one_buffer()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_write_to_buffer_and_scroll()
|
func Test_write_to_buffer_and_scroll()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
new Xscrollbuffer
|
new Xscrollbuffer
|
||||||
call setline(1, range(1, 200))
|
call setline(1, range(1, 200))
|
||||||
@@ -1536,9 +1534,8 @@ func Test_using_freed_memory()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_collapse_buffers()
|
func Test_collapse_buffers()
|
||||||
if !executable('cat')
|
CheckExecutable cat
|
||||||
throw 'Skipped: cat program not found'
|
|
||||||
endif
|
|
||||||
sp test_channel.vim
|
sp test_channel.vim
|
||||||
let g:linecount = line('$')
|
let g:linecount = line('$')
|
||||||
close
|
close
|
||||||
@@ -1550,9 +1547,8 @@ func Test_collapse_buffers()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_write_to_deleted_buffer()
|
func Test_write_to_deleted_buffer()
|
||||||
if !executable('echo')
|
CheckExecutable echo
|
||||||
throw 'Skipped: echo program not found'
|
|
||||||
endif
|
|
||||||
let job = job_start('echo hello', {'out_io': 'buffer', 'out_name': 'test_buffer', 'out_msg': 0})
|
let job = job_start('echo hello', {'out_io': 'buffer', 'out_name': 'test_buffer', 'out_msg': 0})
|
||||||
let bufnr = bufnr('test_buffer')
|
let bufnr = bufnr('test_buffer')
|
||||||
call WaitForAssert({-> assert_equal(['hello'], getbufline(bufnr, 1, '$'))})
|
call WaitForAssert({-> assert_equal(['hello'], getbufline(bufnr, 1, '$'))})
|
||||||
@@ -1585,9 +1581,7 @@ func Test_cmd_parsing()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_raw_passes_nul()
|
func Test_raw_passes_nul()
|
||||||
if !executable('cat')
|
CheckExecutable cat
|
||||||
throw 'Skipped: cat program not found'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Test lines from the job containing NUL are stored correctly in a buffer.
|
" Test lines from the job containing NUL are stored correctly in a buffer.
|
||||||
new
|
new
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
" Tests for the +clientserver feature.
|
" Tests for the +clientserver feature.
|
||||||
|
|
||||||
if !has('job') || !has('clientserver')
|
source check.vim
|
||||||
throw 'Skipped: job and/or clientserver feature missing'
|
CheckFeature job
|
||||||
endif
|
CheckFeature clientserver
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
" Tests for 'conceal'.
|
" Tests for 'conceal'.
|
||||||
" Also see test88.in (should be converted to a test function here).
|
" Also see test88.in (should be converted to a test function here).
|
||||||
|
|
||||||
if !has('conceal')
|
source check.vim
|
||||||
throw 'Skipped: conceal feature missing'
|
CheckFeature conceal
|
||||||
endif
|
|
||||||
|
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
func Test_conceal_two_windows()
|
func Test_conceal_two_windows()
|
||||||
let code =<< trim [CODE]
|
let code =<< trim [CODE]
|
||||||
|
@@ -3,10 +3,7 @@
|
|||||||
source check.vim
|
source check.vim
|
||||||
CheckFeature cscope
|
CheckFeature cscope
|
||||||
CheckFeature quickfix
|
CheckFeature quickfix
|
||||||
|
CheckExecutable cscope
|
||||||
if !executable('cscope')
|
|
||||||
throw 'Skipped: cscope program missing'
|
|
||||||
endif
|
|
||||||
|
|
||||||
func CscopeSetupOrClean(setup)
|
func CscopeSetupOrClean(setup)
|
||||||
if a:setup
|
if a:setup
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
" Run a Vim debugger command
|
" Run a Vim debugger command
|
||||||
" If the expected output argument is supplied, then check for it.
|
" If the expected output argument is supplied, then check for it.
|
||||||
@@ -21,9 +22,7 @@ endfunc
|
|||||||
|
|
||||||
" Debugger tests
|
" Debugger tests
|
||||||
func Test_Debugger()
|
func Test_Debugger()
|
||||||
if !CanRunVimInTerminal()
|
CheckRunVimInTerminal
|
||||||
throw 'Skipped: cannot run Vim in a terminal window'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Create a Vim script with some functions
|
" Create a Vim script with some functions
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
" Tests for when a file was changed outside of Vim.
|
" Tests for when a file was changed outside of Vim.
|
||||||
|
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_FileChangedShell_reload()
|
func Test_FileChangedShell_reload()
|
||||||
if !has('unix')
|
CheckUnix
|
||||||
return
|
|
||||||
endif
|
|
||||||
augroup testreload
|
augroup testreload
|
||||||
au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'reload'
|
au FileChangedShell Xchanged_r let g:reason = v:fcs_reason | let v:fcs_choice = 'reload'
|
||||||
augroup END
|
augroup END
|
||||||
@@ -91,9 +92,8 @@ func Test_FileChangedShell_reload()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_file_changed_dialog()
|
func Test_file_changed_dialog()
|
||||||
if !has('unix') || has('gui_running')
|
CheckUnix
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
au! FileChangedShell
|
au! FileChangedShell
|
||||||
|
|
||||||
new Xchanged_d
|
new Xchanged_d
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
" Test for folding
|
" Test for folding
|
||||||
|
|
||||||
|
source check.vim
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
|
||||||
@@ -707,9 +708,7 @@ func Test_fold_last_line_with_pagedown()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_folds_with_rnu()
|
func Test_folds_with_rnu()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call writefile([
|
call writefile([
|
||||||
\ 'set fdm=marker rnu foldcolumn=2',
|
\ 'set fdm=marker rnu foldcolumn=2',
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
" Tests for various functions.
|
" Tests for various functions.
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
" Must be done first, since the alternate buffer must be unset.
|
" Must be done first, since the alternate buffer must be unset.
|
||||||
func Test_00_bufexists()
|
func Test_00_bufexists()
|
||||||
@@ -1376,9 +1377,8 @@ endfunc
|
|||||||
|
|
||||||
" Test confirm({msg} [, {choices} [, {default} [, {type}]]])
|
" Test confirm({msg} [, {choices} [, {default} [, {type}]]])
|
||||||
func Test_confirm()
|
func Test_confirm()
|
||||||
if !has('unix') || has('gui_running')
|
CheckUnix
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
|
|
||||||
call feedkeys('o', 'L')
|
call feedkeys('o', 'L')
|
||||||
let a = confirm('Press O to proceed')
|
let a = confirm('Press O to proceed')
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
" Tests specifically for the GUI
|
" Tests specifically for the GUI
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
if !CanRunGui()
|
source check.vim
|
||||||
throw 'Skipped: cannot run GUI'
|
CheckCanRunGui
|
||||||
endif
|
|
||||||
|
|
||||||
source setup_gui.vim
|
source setup_gui.vim
|
||||||
|
|
||||||
|
@@ -2,9 +2,8 @@
|
|||||||
" startup to take effect at runtime.
|
" startup to take effect at runtime.
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
if !CanRunGui()
|
source check.vim
|
||||||
throw 'Skipped: cannot run GUI'
|
CheckCanRunGui
|
||||||
endif
|
|
||||||
|
|
||||||
source setup_gui.vim
|
source setup_gui.vim
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source view_util.vim
|
source view_util.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_highlight()
|
func Test_highlight()
|
||||||
" basic test if ":highlight" doesn't crash
|
" basic test if ":highlight" doesn't crash
|
||||||
@@ -532,9 +533,7 @@ func Test_termguicolors()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cursorline_after_yank()
|
func Test_cursorline_after_yank()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call writefile([
|
call writefile([
|
||||||
\ 'set cul rnu',
|
\ 'set cul rnu',
|
||||||
@@ -554,9 +553,7 @@ func Test_cursorline_after_yank()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_cursorline_with_visualmode()
|
func Test_cursorline_with_visualmode()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
call writefile([
|
call writefile([
|
||||||
\ 'set cul',
|
\ 'set cul',
|
||||||
@@ -574,9 +571,7 @@ func Test_cursorline_with_visualmode()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_wincolor()
|
func Test_wincolor()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
|
|
||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
set cursorline cursorcolumn rnu
|
set cursorline cursorcolumn rnu
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
" Tests for mappings and abbreviations
|
" Tests for mappings and abbreviations
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_abbreviation()
|
func Test_abbreviation()
|
||||||
" abbreviation with 0x80 should work
|
" abbreviation with 0x80 should work
|
||||||
@@ -399,7 +400,9 @@ func Test_motionforce_omap()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_error_in_map_expr()
|
func Test_error_in_map_expr()
|
||||||
if !has('terminal') || (has('win32') && has('gui_running'))
|
" Unlike CheckRunVimInTerminal this does work in a win32 console
|
||||||
|
CheckFeature terminal
|
||||||
|
if has('win32') && has('gui_running')
|
||||||
throw 'Skipped: cannot run Vim in a terminal window'
|
throw 'Skipped: cannot run Vim in a terminal window'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
|
" matchaddpos(), matcharg(), matchdelete(), and setmatches().
|
||||||
|
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
function Test_match()
|
function Test_match()
|
||||||
highlight MyGroup1 term=bold ctermbg=red guibg=red
|
highlight MyGroup1 term=bold ctermbg=red guibg=red
|
||||||
@@ -267,9 +268,8 @@ func OtherWindowCommon()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_matchdelete_other_window()
|
func Test_matchdelete_other_window()
|
||||||
if !CanRunVimInTerminal()
|
CheckScreendump
|
||||||
throw 'Skipped: cannot make screendumps'
|
|
||||||
endif
|
|
||||||
let buf = OtherWindowCommon()
|
let buf = OtherWindowCommon()
|
||||||
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
|
call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>")
|
||||||
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
|
call VerifyScreenDump(buf, 'Test_matchdelete_1', {})
|
||||||
|
@@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
source check.vim
|
source check.vim
|
||||||
CheckFeature terminal
|
CheckFeature terminal
|
||||||
|
CheckNotGui
|
||||||
|
|
||||||
if has('gui_running')
|
|
||||||
throw 'Skipped: does not work in GUI'
|
|
||||||
endif
|
|
||||||
if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
|
if execute('version') =~# '-fsanitize=[a-z,]*\<address\>'
|
||||||
" Skip tests on Travis CI ASAN build because it's difficult to estimate
|
" Skip tests on Travis CI ASAN build because it's difficult to estimate
|
||||||
" memory usage.
|
" memory usage.
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
" Test for options
|
" Test for options
|
||||||
|
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_whichwrap()
|
func Test_whichwrap()
|
||||||
set whichwrap=b,s
|
set whichwrap=b,s
|
||||||
call assert_equal('b,s', &whichwrap)
|
call assert_equal('b,s', &whichwrap)
|
||||||
@@ -296,9 +298,8 @@ endfunc
|
|||||||
|
|
||||||
" Must be executed before other tests that set 'term'.
|
" Must be executed before other tests that set 'term'.
|
||||||
func Test_000_term_option_verbose()
|
func Test_000_term_option_verbose()
|
||||||
if has('gui_running')
|
CheckNotGui
|
||||||
return
|
|
||||||
endif
|
|
||||||
let verb_cm = execute('verbose set t_cm')
|
let verb_cm = execute('verbose set t_cm')
|
||||||
call assert_notmatch('Last set from', verb_cm)
|
call assert_notmatch('Last set from', verb_cm)
|
||||||
|
|
||||||
@@ -310,7 +311,9 @@ func Test_000_term_option_verbose()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_set_ttytype()
|
func Test_set_ttytype()
|
||||||
if !has('gui_running') && has('unix')
|
CheckUnix
|
||||||
|
CheckNotGui
|
||||||
|
|
||||||
" Setting 'ttytype' used to cause a double-free when exiting vim and
|
" Setting 'ttytype' used to cause a double-free when exiting vim and
|
||||||
" when vim is compiled with -DEXITFREE.
|
" when vim is compiled with -DEXITFREE.
|
||||||
set ttytype=ansi
|
set ttytype=ansi
|
||||||
@@ -337,7 +340,6 @@ func Test_set_ttytype()
|
|||||||
|
|
||||||
set ttytype&
|
set ttytype&
|
||||||
call assert_equal(&ttytype, &term)
|
call assert_equal(&ttytype, &term)
|
||||||
endif
|
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_set_all()
|
func Test_set_all()
|
||||||
|
@@ -1,12 +1,10 @@
|
|||||||
" Tests for bracketed paste and other forms of pasting.
|
" Tests for bracketed paste and other forms of pasting.
|
||||||
|
|
||||||
" Bracketed paste only works with "xterm". Not in GUI or Windows console.
|
" Bracketed paste only works with "xterm". Not in GUI or Windows console.
|
||||||
if has('win32')
|
source check.vim
|
||||||
throw 'Skipped: does not work on MS-Windows'
|
CheckNotMSWindows
|
||||||
endif
|
CheckNotGui
|
||||||
if has('gui_running')
|
|
||||||
throw 'Skipped: does not work in the GUI'
|
|
||||||
endif
|
|
||||||
set term=xterm
|
set term=xterm
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
|
||||||
let g:setting = ''
|
let g:setting = ''
|
||||||
@@ -663,9 +664,9 @@ func Test_complete_CTRLN_startofbuffer()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_popup_and_window_resize()
|
func Test_popup_and_window_resize()
|
||||||
if !has('terminal') || has('gui_running')
|
CheckFeature terminal
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
let h = winheight(0)
|
let h = winheight(0)
|
||||||
if h < 15
|
if h < 15
|
||||||
return
|
return
|
||||||
@@ -918,9 +919,9 @@ func Test_complete_o_tab()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_menu_only_exists_in_terminal()
|
func Test_menu_only_exists_in_terminal()
|
||||||
if !exists(':tlmenu') || has('gui_running')
|
CheckCommand tlmenu
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
tlnoremenu &Edit.&Paste<Tab>"+gP <C-W>"+
|
tlnoremenu &Edit.&Paste<Tab>"+gP <C-W>"+
|
||||||
aunmenu *
|
aunmenu *
|
||||||
try
|
try
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
func Test_search_cmdline()
|
func Test_search_cmdline()
|
||||||
if !exists('+incsearch')
|
if !exists('+incsearch')
|
||||||
@@ -575,12 +576,13 @@ endfunc
|
|||||||
func Test_search_cmdline8()
|
func Test_search_cmdline8()
|
||||||
" Highlighting is cleared in all windows
|
" Highlighting is cleared in all windows
|
||||||
" since hls applies to all windows
|
" since hls applies to all windows
|
||||||
if !exists('+incsearch') || !has('terminal') || has('gui_running') || winwidth(0) < 30
|
CheckOption incsearch
|
||||||
return
|
CheckFeature terminal
|
||||||
endif
|
CheckNotGui
|
||||||
if has("win32")
|
if has("win32")
|
||||||
throw "Skipped: Bug with sending <ESC> to terminal window not fixed yet"
|
throw "Skipped: Bug with sending <ESC> to terminal window not fixed yet"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let h = winheight(0)
|
let h = winheight(0)
|
||||||
if h < 3
|
if h < 3
|
||||||
return
|
return
|
||||||
@@ -702,9 +704,10 @@ func Test_search_cmdline_incsearch_highlight()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_search_cmdline_incsearch_highlight_attr()
|
func Test_search_cmdline_incsearch_highlight_attr()
|
||||||
if !exists('+incsearch') || !has('terminal') || has('gui_running')
|
CheckOption incsearch
|
||||||
return
|
CheckFeature terminal
|
||||||
endif
|
CheckNotGui
|
||||||
|
|
||||||
let h = winheight(0)
|
let h = winheight(0)
|
||||||
if h < 3
|
if h < 3
|
||||||
return
|
return
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
" Test signal handling.
|
" Test signal handling.
|
||||||
|
|
||||||
if !has('unix')
|
source check.vim
|
||||||
throw 'Skipped: not on Unix'
|
CheckUnix
|
||||||
endif
|
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
|
||||||
@@ -14,8 +13,9 @@ endfunc
|
|||||||
|
|
||||||
" Test signal WINCH (window resize signal)
|
" Test signal WINCH (window resize signal)
|
||||||
func Test_signal_WINCH()
|
func Test_signal_WINCH()
|
||||||
if has('gui_running') || !HasSignal('WINCH')
|
CheckNotGui
|
||||||
return
|
if !HasSignal('WINCH')
|
||||||
|
throw 'Skipped: WINCH signal not supported'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" We do not actually want to change the size of the terminal.
|
" We do not actually want to change the size of the terminal.
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
source check.vim
|
||||||
|
|
||||||
" Check that loading startup.vim works.
|
" Check that loading startup.vim works.
|
||||||
func Test_startup_script()
|
func Test_startup_script()
|
||||||
@@ -262,10 +263,9 @@ endfunc
|
|||||||
|
|
||||||
" Test the -V[N] argument to set the 'verbose' option to [N]
|
" Test the -V[N] argument to set the 'verbose' option to [N]
|
||||||
func Test_V_arg()
|
func Test_V_arg()
|
||||||
if has('gui_running')
|
|
||||||
" Can't catch the output of gvim.
|
" Can't catch the output of gvim.
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
let out = system(GetVimCommand() . ' --clean -es -X -V0 -c "set verbose?" -cq')
|
let out = system(GetVimCommand() . ' --clean -es -X -V0 -c "set verbose?" -cq')
|
||||||
call assert_equal(" verbose=0\n", out)
|
call assert_equal(" verbose=0\n", out)
|
||||||
|
|
||||||
@@ -395,10 +395,9 @@ func Test_A_F_H_arg()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_invalid_args()
|
func Test_invalid_args()
|
||||||
if !has('unix') || has('gui_running')
|
" must be able to get the output of Vim.
|
||||||
" can't get output of Vim.
|
CheckUnix
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
|
|
||||||
for opt in ['-Y', '--does-not-exist']
|
for opt in ['-Y', '--does-not-exist']
|
||||||
let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
|
let out = split(system(GetVimCommand() .. ' ' .. opt), "\n")
|
||||||
@@ -599,10 +598,9 @@ func Test_progpath()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_silent_ex_mode()
|
func Test_silent_ex_mode()
|
||||||
if !has('unix') || has('gui_running')
|
" must be able to get the output of Vim.
|
||||||
" can't get output of Vim.
|
CheckUnix
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
|
|
||||||
" This caused an ml_get error.
|
" This caused an ml_get error.
|
||||||
let out = system(GetVimCommand() . '-u NONE -es -c''set verbose=1|h|exe "%norm\<c-y>\<c-d>"'' -c cq')
|
let out = system(GetVimCommand() . '-u NONE -es -c''set verbose=1|h|exe "%norm\<c-y>\<c-d>"'' -c cq')
|
||||||
@@ -610,10 +608,9 @@ func Test_silent_ex_mode()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_default_term()
|
func Test_default_term()
|
||||||
if !has('unix') || has('gui_running')
|
" must be able to get the output of Vim.
|
||||||
" can't get output of Vim.
|
CheckUnix
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
|
|
||||||
let save_term = $TERM
|
let save_term = $TERM
|
||||||
let $TERM = 'unknownxxx'
|
let $TERM = 'unknownxxx'
|
||||||
@@ -649,10 +646,9 @@ func Test_zzz_startinsert()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_issue_3969()
|
func Test_issue_3969()
|
||||||
if has('gui_running')
|
|
||||||
" Can't catch the output of gvim.
|
" Can't catch the output of gvim.
|
||||||
return
|
CheckNotGui
|
||||||
endif
|
|
||||||
" Check that message is not truncated.
|
" Check that message is not truncated.
|
||||||
let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
|
let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
|
||||||
call assert_equal('hello', out)
|
call assert_equal('hello', out)
|
||||||
|
@@ -413,9 +413,8 @@ func Test_highlight_invalid_arg()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_bg_detection()
|
func Test_bg_detection()
|
||||||
if has('gui_running')
|
CheckNotGui
|
||||||
return
|
|
||||||
endif
|
|
||||||
" auto-detection of &bg, make sure sure it isn't set anywhere before
|
" auto-detection of &bg, make sure sure it isn't set anywhere before
|
||||||
" this test
|
" this test
|
||||||
hi Normal ctermbg=0
|
hi Normal ctermbg=0
|
||||||
|
@@ -1,12 +1,9 @@
|
|||||||
" Tests for decoding escape sequences sent by the terminal.
|
" Tests for decoding escape sequences sent by the terminal.
|
||||||
|
|
||||||
" This only works for Unix in a terminal
|
" This only works for Unix in a terminal
|
||||||
if has('gui_running')
|
source check.vim
|
||||||
throw 'Skipped: does not work in the GUI'
|
CheckNotGui
|
||||||
endif
|
CheckUnix
|
||||||
if !has('unix')
|
|
||||||
throw 'Skipped: not on Unix'
|
|
||||||
endif
|
|
||||||
|
|
||||||
source shared.vim
|
source shared.vim
|
||||||
|
|
||||||
|
@@ -1788,9 +1788,7 @@ endfunc
|
|||||||
|
|
||||||
" must be nearly the last, we can't go back from GUI to terminal
|
" must be nearly the last, we can't go back from GUI to terminal
|
||||||
func Test_zz1_terminal_in_gui()
|
func Test_zz1_terminal_in_gui()
|
||||||
if !CanRunGui()
|
CheckCanRunGui
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Ignore the "failed to create input context" error.
|
" Ignore the "failed to create input context" error.
|
||||||
call test_ignore_error('E285:')
|
call test_ignore_error('E285:')
|
||||||
@@ -1810,9 +1808,7 @@ func Test_zz1_terminal_in_gui()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_zz2_terminal_guioptions_bang()
|
func Test_zz2_terminal_guioptions_bang()
|
||||||
if !has('gui_running')
|
CheckGui
|
||||||
return
|
|
||||||
endif
|
|
||||||
set guioptions+=!
|
set guioptions+=!
|
||||||
|
|
||||||
let filename = 'Xtestscript'
|
let filename = 'Xtestscript'
|
||||||
|
@@ -239,9 +239,9 @@ func Interrupt(timer)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_peek_and_get_char()
|
func Test_peek_and_get_char()
|
||||||
if !has('unix') && !has('gui_running')
|
CheckUnix
|
||||||
return
|
CheckGui
|
||||||
endif
|
|
||||||
call timer_start(0, 'FeedAndPeek')
|
call timer_start(0, 'FeedAndPeek')
|
||||||
let intr = timer_start(100, 'Interrupt')
|
let intr = timer_start(100, 'Interrupt')
|
||||||
let c = getchar()
|
let c = getchar()
|
||||||
@@ -251,8 +251,7 @@ endfunc
|
|||||||
|
|
||||||
func Test_getchar_zero()
|
func Test_getchar_zero()
|
||||||
if has('win32') && !has('gui_running')
|
if has('win32') && !has('gui_running')
|
||||||
" Console: no low-level input
|
throw 'Skipped: cannot get low-level input'
|
||||||
return
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Measure the elapsed time to avoid a hang when it fails.
|
" Measure the elapsed time to avoid a hang when it fails.
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
" Test various aspects of the Vim script language.
|
" Test various aspects of the Vim script language.
|
||||||
" Most of this was formerly in test49.
|
" Most of this was formerly in test49.
|
||||||
|
|
||||||
|
source check.vim
|
||||||
|
|
||||||
"-------------------------------------------------------------------------------
|
"-------------------------------------------------------------------------------
|
||||||
" Test environment {{{1
|
" Test environment {{{1
|
||||||
"-------------------------------------------------------------------------------
|
"-------------------------------------------------------------------------------
|
||||||
@@ -1677,10 +1679,7 @@ func Test_funccall_garbage_collect()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_function_defined_line()
|
func Test_function_defined_line()
|
||||||
if has('gui_running')
|
CheckNotGui
|
||||||
" Can't catch the output of gvim.
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let lines =<< trim [CODE]
|
let lines =<< trim [CODE]
|
||||||
" F1
|
" F1
|
||||||
|
@@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1826,
|
||||||
/**/
|
/**/
|
||||||
1825,
|
1825,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user