1
0
forked from aniani/vim

patch 8.2.0409: search test leaves file behind

Problem:    Search test leaves file behind.
Solution:   Delete the file.  Also use Check commands.
This commit is contained in:
Bram Moolenaar
2020-03-19 15:05:28 +01:00
parent 22da5596d0
commit b68df220c5
2 changed files with 60 additions and 90 deletions

View File

@@ -5,9 +5,8 @@ source screendump.vim
source check.vim source check.vim
func Test_search_cmdline() func Test_search_cmdline()
if !exists('+incsearch') CheckOption incsearch
return
endif
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
call test_override("char_avail", 1) call test_override("char_avail", 1)
@@ -202,9 +201,8 @@ func Test_search_cmdline()
endfunc endfunc
func Test_search_cmdline2() func Test_search_cmdline2()
if !exists('+incsearch') CheckOption incsearch
return
endif
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
call test_override("char_avail", 1) call test_override("char_avail", 1)
@@ -446,9 +444,8 @@ func Incsearch_cleanup()
endfunc endfunc
func Test_search_cmdline3() func Test_search_cmdline3()
if !exists('+incsearch') CheckOption incsearch
return
endif
call Cmdline3_prep() call Cmdline3_prep()
1 1
" first match " first match
@@ -459,9 +456,8 @@ func Test_search_cmdline3()
endfunc endfunc
func Test_search_cmdline3s() func Test_search_cmdline3s()
if !exists('+incsearch') CheckOption incsearch
return
endif
call Cmdline3_prep() call Cmdline3_prep()
1 1
call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx') call feedkeys(":%s/the\<c-l>/xxx\<cr>", 'tx')
@@ -485,9 +481,8 @@ func Test_search_cmdline3s()
endfunc endfunc
func Test_search_cmdline3g() func Test_search_cmdline3g()
if !exists('+incsearch') CheckOption incsearch
return
endif
call Cmdline3_prep() call Cmdline3_prep()
1 1
call feedkeys(":g/the\<c-l>/d\<cr>", 'tx') call feedkeys(":g/the\<c-l>/d\<cr>", 'tx')
@@ -508,9 +503,8 @@ func Test_search_cmdline3g()
endfunc endfunc
func Test_search_cmdline3v() func Test_search_cmdline3v()
if !exists('+incsearch') CheckOption incsearch
return
endif
call Cmdline3_prep() call Cmdline3_prep()
1 1
call feedkeys(":v/the\<c-l>/d\<cr>", 'tx') call feedkeys(":v/the\<c-l>/d\<cr>", 'tx')
@@ -525,9 +519,8 @@ func Test_search_cmdline3v()
endfunc endfunc
func Test_search_cmdline4() func Test_search_cmdline4()
if !exists('+incsearch') CheckOption incsearch
return
endif
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
call test_override("char_avail", 1) call test_override("char_avail", 1)
@@ -559,9 +552,8 @@ func Test_search_cmdline4()
endfunc endfunc
func Test_search_cmdline5() func Test_search_cmdline5()
if !exists('+incsearch') CheckOption incsearch
return
endif
" Do not call test_override("char_avail", 1) so that <C-g> and <C-t> work " Do not call test_override("char_avail", 1) so that <C-g> and <C-t> work
" regardless char_avail. " regardless char_avail.
new new
@@ -581,9 +573,8 @@ endfunc
func Test_search_cmdline6() func Test_search_cmdline6()
" Test that consecutive matches " Test that consecutive matches
" are caught by <c-g>/<c-t> " are caught by <c-g>/<c-t>
if !exists('+incsearch') CheckOption incsearch
return
endif
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
call test_override("char_avail", 1) call test_override("char_avail", 1)
@@ -621,9 +612,8 @@ endfunc
func Test_search_cmdline7() func Test_search_cmdline7()
" Test that an pressing <c-g> in an empty command line " Test that an pressing <c-g> in an empty command line
" does not move the cursor " does not move the cursor
if !exists('+incsearch') CheckOption incsearch
return
endif
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
call test_override("char_avail", 1) call test_override("char_avail", 1)
@@ -754,9 +744,8 @@ func Test_search_regexp()
endfunc endfunc
func Test_search_cmdline_incsearch_highlight() func Test_search_cmdline_incsearch_highlight()
if !exists('+incsearch') CheckOption incsearch
return
endif
set incsearch hlsearch set incsearch hlsearch
" need to disable char_avail, " need to disable char_avail,
" so that expansion of commandline works " so that expansion of commandline works
@@ -874,9 +863,8 @@ func Test_search_cmdline_incsearch_highlight_attr()
endfunc endfunc
func Test_incsearch_cmdline_modifier() func Test_incsearch_cmdline_modifier()
if !exists('+incsearch') CheckOption incsearch
return
endif
call test_override("char_avail", 1) call test_override("char_avail", 1)
new new
call setline(1, ['foo']) call setline(1, ['foo'])
@@ -918,12 +906,9 @@ func Test_incsearch_scrolling()
endfunc endfunc
func Test_incsearch_search_dump() func Test_incsearch_search_dump()
if !exists('+incsearch') CheckOption incsearch
return CheckScreendump
endif
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
\ 'for n in range(1, 8)', \ 'for n in range(1, 8)',
@@ -951,9 +936,8 @@ func Test_incsearch_search_dump()
endfunc endfunc
func Test_incsearch_substitute() func Test_incsearch_substitute()
if !exists('+incsearch') CheckOption incsearch
return
endif
call test_override("char_avail", 1) call test_override("char_avail", 1)
new new
set incsearch set incsearch
@@ -973,12 +957,9 @@ endfunc
" Similar to Test_incsearch_substitute() but with a screendump halfway. " Similar to Test_incsearch_substitute() but with a screendump halfway.
func Test_incsearch_substitute_dump() func Test_incsearch_substitute_dump()
if !exists('+incsearch') CheckOption incsearch
return CheckScreendump
endif
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
\ 'for n in range(1, 10)', \ 'for n in range(1, 10)',
@@ -1085,12 +1066,8 @@ func Test_incsearch_substitute_dump()
endfunc endfunc
func Test_incsearch_highlighting() func Test_incsearch_highlighting()
if !exists('+incsearch') CheckOption incsearch
return CheckScreendump
endif
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
call writefile([ call writefile([
\ 'set incsearch hlsearch', \ 'set incsearch hlsearch',
@@ -1106,12 +1083,15 @@ func Test_incsearch_highlighting()
call term_sendkeys(buf, ":%s;ello/the") call term_sendkeys(buf, ":%s;ello/the")
call VerifyScreenDump(buf, 'Test_incsearch_substitute_15', {}) call VerifyScreenDump(buf, 'Test_incsearch_substitute_15', {})
call term_sendkeys(buf, "<Esc>") call term_sendkeys(buf, "<Esc>")
call StopVimInTerminal(buf)
call delete('Xis_subst_hl_script')
endfunc endfunc
func Test_incsearch_with_change() func Test_incsearch_with_change()
if !has('timers') || !exists('+incsearch') || !CanRunVimInTerminal() CheckFeature timers
throw 'Skipped: cannot make screendumps and/or timers feature and/or incsearch option missing' CheckOption incsearch
endif CheckScreendump
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
@@ -1134,12 +1114,9 @@ endfunc
" Similar to Test_incsearch_substitute_dump() for :sort " Similar to Test_incsearch_substitute_dump() for :sort
func Test_incsearch_sort_dump() func Test_incsearch_sort_dump()
if !exists('+incsearch') CheckOption incsearch
return CheckScreendump
endif
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
\ 'call setline(1, ["another one 2", "that one 3", "the one 1"])', \ 'call setline(1, ["another one 2", "that one 3", "the one 1"])',
@@ -1160,12 +1137,9 @@ endfunc
" Similar to Test_incsearch_substitute_dump() for :vimgrep famiry " Similar to Test_incsearch_substitute_dump() for :vimgrep famiry
func Test_incsearch_vimgrep_dump() func Test_incsearch_vimgrep_dump()
if !exists('+incsearch') CheckOption incsearch
return CheckScreendump
endif
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'
endif
call writefile([ call writefile([
\ 'set incsearch hlsearch scrolloff=0', \ 'set incsearch hlsearch scrolloff=0',
\ 'call setline(1, ["another one 2", "that one 3", "the one 1"])', \ 'call setline(1, ["another one 2", "that one 3", "the one 1"])',
@@ -1201,9 +1175,8 @@ func Test_incsearch_vimgrep_dump()
endfunc endfunc
func Test_keep_last_search_pattern() func Test_keep_last_search_pattern()
if !exists('+incsearch') CheckOption incsearch
return
endif
new new
call setline(1, ['foo', 'foo', 'foo']) call setline(1, ['foo', 'foo', 'foo'])
set incsearch set incsearch
@@ -1222,9 +1195,8 @@ func Test_keep_last_search_pattern()
endfunc endfunc
func Test_word_under_cursor_after_match() func Test_word_under_cursor_after_match()
if !exists('+incsearch') CheckOption incsearch
return
endif
new new
call setline(1, 'foo bar') call setline(1, 'foo bar')
set incsearch set incsearch
@@ -1241,9 +1213,8 @@ func Test_word_under_cursor_after_match()
endfunc endfunc
func Test_subst_word_under_cursor() func Test_subst_word_under_cursor()
if !exists('+incsearch') CheckOption incsearch
return
endif
new new
call setline(1, ['int SomeLongName;', 'for (xxx = 1; xxx < len; ++xxx)']) call setline(1, ['int SomeLongName;', 'for (xxx = 1; xxx < len; ++xxx)'])
set incsearch set incsearch
@@ -1258,9 +1229,8 @@ func Test_subst_word_under_cursor()
endfunc endfunc
func Test_search_undefined_behaviour() func Test_search_undefined_behaviour()
if !has("terminal") CheckFeature terminal
return
endif
let h = winheight(0) let h = winheight(0)
if h < 3 if h < 3
return return
@@ -1326,9 +1296,8 @@ func Test_search_Ctrl_L_combining()
" ' ̇' U+0307 Dec:775 COMBINING DOT ABOVE &#x307; /\%u307\Z "\u0307" " ' ̇' U+0307 Dec:775 COMBINING DOT ABOVE &#x307; /\%u307\Z "\u0307"
" ' ̣' U+0323 Dec:803 COMBINING DOT BELOW &#x323; /\%u323 "\u0323" " ' ̣' U+0323 Dec:803 COMBINING DOT BELOW &#x323; /\%u323 "\u0323"
" Those should also appear on the commandline " Those should also appear on the commandline
if !exists('+incsearch') CheckOption incsearch
return
endif
call Cmdline3_prep() call Cmdline3_prep()
1 1
let bufcontent = ['', 'Miạ̀́̇m'] let bufcontent = ['', 'Miạ̀́̇m']
@@ -1377,9 +1346,8 @@ func Test_one_error_msg()
endfunc endfunc
func Test_incsearch_add_char_under_cursor() func Test_incsearch_add_char_under_cursor()
if !exists('+incsearch') CheckOption incsearch
return
endif
set incsearch set incsearch
new new
call setline(1, ['find match', 'anything']) call setline(1, ['find match', 'anything'])

View File

@@ -738,6 +738,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 */
/**/
409,
/**/ /**/
408, 408,
/**/ /**/