mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 7.4.2343
Problem: Too many old file tests. Solution: Turn several into new style tests. (Yegappan Lakshmanan)
This commit is contained in:
@@ -2041,7 +2041,7 @@ test1 \
|
||||
test_search_mbyte \
|
||||
test_utf8 \
|
||||
test_wordcount \
|
||||
test2 test3 test4 test5 test6 test7 test8 test9 \
|
||||
test3 test4 test5 test6 test7 test8 test9 \
|
||||
test11 test12 test14 test15 test17 test18 test19 \
|
||||
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
|
||||
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
|
||||
@@ -2085,12 +2085,14 @@ test_arglist \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_glob2regpat \
|
||||
test_gf \
|
||||
test_gn \
|
||||
test_goto \
|
||||
test_gui \
|
||||
test_hardcopy \
|
||||
test_help_tagjump \
|
||||
test_history \
|
||||
test_hlsearch \
|
||||
test_increment \
|
||||
test_increment_dbcs \
|
||||
test_job_fails \
|
||||
@@ -2128,6 +2130,7 @@ test_arglist \
|
||||
test_signs \
|
||||
test_sort \
|
||||
test_source_utf8 \
|
||||
test_smartindent \
|
||||
test_startup \
|
||||
test_startup_utf8 \
|
||||
test_stat \
|
||||
|
@@ -13,16 +13,13 @@ SCRIPTS_ALL = \
|
||||
test3.out \
|
||||
test4.out \
|
||||
test5.out \
|
||||
test6.out \
|
||||
test7.out \
|
||||
test8.out \
|
||||
test9.out \
|
||||
test14.out \
|
||||
test15.out \
|
||||
test18.out \
|
||||
test19.out \
|
||||
test20.out \
|
||||
test21.out \
|
||||
test22.out \
|
||||
test23.out \
|
||||
test24.out \
|
||||
@@ -74,7 +71,6 @@ SCRIPTS_ALL = \
|
||||
test95.out \
|
||||
test98.out \
|
||||
test99.out \
|
||||
test101.out \
|
||||
test103.out \
|
||||
test104.out \
|
||||
test107.out \
|
||||
@@ -109,7 +105,6 @@ SCRIPTS_MORE1 = \
|
||||
|
||||
# Tests that run on most systems, but not on Amiga and DOS/Windows.
|
||||
SCRIPTS_MORE2 = \
|
||||
test2.out \
|
||||
test12.out \
|
||||
test25.out \
|
||||
test49.out \
|
||||
@@ -147,7 +142,7 @@ SCRIPTS_GUI =
|
||||
# Keep test_alot*.res as the last one, sort the others.
|
||||
NEW_TESTS = test_arglist.res \
|
||||
test_assert.res \
|
||||
test_autochdir \
|
||||
test_autochdir.res \
|
||||
test_backspace_opt.res \
|
||||
test_bufwintabinfo.res \
|
||||
test_cdo.res \
|
||||
@@ -159,10 +154,12 @@ NEW_TESTS = test_arglist.res \
|
||||
test_digraph.res \
|
||||
test_farsi.res \
|
||||
test_fnameescape.res \
|
||||
test_gf.res \
|
||||
test_gn.res \
|
||||
test_gui.res \
|
||||
test_hardcopy.res \
|
||||
test_history.res \
|
||||
test_hlsearch.res \
|
||||
test_increment.res \
|
||||
test_increment_dbcs.res \
|
||||
test_job_fails.res \
|
||||
@@ -180,6 +177,7 @@ NEW_TESTS = test_arglist.res \
|
||||
test_ruby.res \
|
||||
test_search.res \
|
||||
test_signs.res \
|
||||
test_smartindent.res \
|
||||
test_startup.res \
|
||||
test_startup_utf8.res \
|
||||
test_stat.res \
|
||||
|
@@ -1,48 +0,0 @@
|
||||
Test for v:hlsearch vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:" Last abc: Q
|
||||
:so small.vim
|
||||
:new
|
||||
:call setline(1, repeat(['aaa'], 10))
|
||||
:set hlsearch nolazyredraw
|
||||
:let r=[]
|
||||
:command -nargs=0 -bar AddR :call add(r, [screenattr(1, 1), v:hlsearch])
|
||||
/aaa
|
||||
:AddR
|
||||
:nohlsearch
|
||||
:AddR
|
||||
:let v:hlsearch=1
|
||||
:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
:set hlsearch
|
||||
:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
n:AddR
|
||||
:let v:hlsearch=0
|
||||
:AddR
|
||||
/
|
||||
:AddR
|
||||
:set nohls
|
||||
/
|
||||
:AddR
|
||||
:let r1=r[0][0]
|
||||
:" I guess it is not guaranteed that screenattr outputs always the same character
|
||||
:call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
|
||||
:try
|
||||
: let v:hlsearch=[]
|
||||
:catch
|
||||
: call add(r, matchstr(v:exception,'^Vim(let):E\d\+:'))
|
||||
:endtry
|
||||
:bwipeout!
|
||||
:$put=r
|
||||
:call garbagecollect(1)
|
||||
:"
|
||||
:/^start:/,$wq! test.out
|
||||
:" vim: et ts=4 isk-=\:
|
||||
:call getchar()
|
||||
ENDTEST
|
||||
|
||||
start:
|
@@ -1,12 +0,0 @@
|
||||
start:
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
1:highlighted
|
||||
0:not highlighted
|
||||
Vim(let):E745:
|
@@ -1,16 +0,0 @@
|
||||
Tests for not doing smart indenting when it isn't set.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set nocin nosi ai
|
||||
/some
|
||||
2cc#test
|
||||
:?start?,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start text
|
||||
some test text
|
||||
test text
|
||||
test text
|
||||
test text
|
@@ -1,4 +0,0 @@
|
||||
start text
|
||||
#test
|
||||
test text
|
||||
test text
|
@@ -1,29 +0,0 @@
|
||||
|
||||
This is a test if a URL is recognized by "gf", with the cursor before and
|
||||
after the "://". Also test ":\\".
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/^first
|
||||
/tmp
|
||||
:call append(0, expand("<cfile>"))
|
||||
/^second
|
||||
/URL
|
||||
:call append(1, expand("<cfile>"))
|
||||
:if has("ebcdic")
|
||||
: set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
|
||||
:else
|
||||
: set isf=@,48-57,/,.,-,_,+,,,$,:,~,\
|
||||
:endif
|
||||
/^third
|
||||
/name
|
||||
:call append(2, expand("<cfile>"))
|
||||
/^fourth
|
||||
/URL
|
||||
:call append(3, expand("<cfile>"))
|
||||
5GdG:wq! test.out
|
||||
ENDTEST
|
||||
first test for URL://machine.name/tmp/vimtest2a and other text
|
||||
second test for URL://machine.name/tmp/vimtest2b. And other text
|
||||
third test for URL:\\machine.name\vimtest2c and other text
|
||||
fourth test for URL:\\machine.name\tmp\vimtest2d, and other text
|
@@ -1,4 +0,0 @@
|
||||
URL://machine.name/tmp/vimtest2a
|
||||
URL://machine.name/tmp/vimtest2b
|
||||
URL:\\machine.name\vimtest2c
|
||||
URL:\\machine.name\tmp\vimtest2d
|
@@ -1,19 +0,0 @@
|
||||
Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
/start
|
||||
6[ :.w! test.out
|
||||
?start here
|
||||
6 :.w >>test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
#include test21.in
|
||||
|
||||
/* test text test tex start here
|
||||
some text
|
||||
test text
|
||||
start OK if found this line
|
||||
start found wrong line
|
||||
test text
|
@@ -1,2 +0,0 @@
|
||||
start OK if found this line
|
||||
start OK if found this line
|
@@ -1,24 +0,0 @@
|
||||
Test for autocommand that redefines the argument list, when doing ":all".
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:au BufReadPost Xxx2 next Xxx2 Xxx1
|
||||
/^start of
|
||||
A1:.,/end of/w! Xxx1 " write test file Xxx1
|
||||
$r2:.,/end of/w! Xxx2 " write test file Xxx2
|
||||
$r3:.,/end of/w! Xxx3 " write test file Xxx3
|
||||
:next! Xxx1 Xxx2 Xxx3 " redefine arglist; go to Xxx1
|
||||
:all " open window for all args
|
||||
:w! test.out " Write contents of Xxx1
|
||||
:w >>test.out " Append contents of last window (Xxx1)
|
||||
:rew " should now be in Xxx2
|
||||
:w >>test.out " Append contents of Xxx2
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of test file Xxx
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
end of test file Xxx
|
@@ -1,18 +0,0 @@
|
||||
start of test file Xxx1
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
end of test file Xxx
|
||||
start of test file Xxx1
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
end of test file Xxx
|
||||
start of test file Xxx2
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
this is a test
|
||||
end of test file Xxx
|
@@ -287,3 +287,32 @@ function Test_argpos()
|
||||
call assert_equal(0, argidx())
|
||||
%argd
|
||||
endfunction
|
||||
|
||||
" Test for autocommand that redefines the argument list, when doing ":all".
|
||||
function Test_arglist_autocmd()
|
||||
autocmd BufReadPost Xxx2 next Xxx2 Xxx1
|
||||
call writefile(['test file Xxx1'], 'Xxx1')
|
||||
call writefile(['test file Xxx2'], 'Xxx2')
|
||||
call writefile(['test file Xxx3'], 'Xxx3')
|
||||
|
||||
new
|
||||
" redefine arglist; go to Xxx1
|
||||
next! Xxx1 Xxx2 Xxx3
|
||||
" open window for all args
|
||||
all
|
||||
call assert_equal('test file Xxx1', getline(1))
|
||||
wincmd w
|
||||
wincmd w
|
||||
call assert_equal('test file Xxx1', getline(1))
|
||||
" should now be in Xxx2
|
||||
rewind
|
||||
call assert_equal('test file Xxx2', getline(1))
|
||||
|
||||
autocmd! BufReadPost Xxx2
|
||||
enew! | only
|
||||
call delete('Xxx1')
|
||||
call delete('Xxx2')
|
||||
call delete('Xxx3')
|
||||
argdelete Xxx*
|
||||
bwipe! Xxx1 Xxx2 Xxx3
|
||||
endfunction
|
||||
|
33
src/testdir/test_gf.vim
Normal file
33
src/testdir/test_gf.vim
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
" This is a test if a URL is recognized by "gf", with the cursor before and
|
||||
" after the "://". Also test ":\\".
|
||||
function! Test_gf_url()
|
||||
enew!
|
||||
call append(0, [
|
||||
\ "first test for URL://machine.name/tmp/vimtest2a and other text",
|
||||
\ "second test for URL://machine.name/tmp/vimtest2b. And other text",
|
||||
\ "third test for URL:\\\\machine.name\\vimtest2c and other text",
|
||||
\ "fourth test for URL:\\\\machine.name\\tmp\\vimtest2d, and other text"
|
||||
\ ])
|
||||
call cursor(1,1)
|
||||
call search("^first")
|
||||
call search("tmp")
|
||||
call assert_equal("URL://machine.name/tmp/vimtest2a", expand("<cfile>"))
|
||||
call search("^second")
|
||||
call search("URL")
|
||||
call assert_equal("URL://machine.name/tmp/vimtest2b", expand("<cfile>"))
|
||||
if has("ebcdic")
|
||||
set isf=@,240-249,/,.,-,_,+,,,$,:,~,\
|
||||
else
|
||||
set isf=@,48-57,/,.,-,_,+,,,$,:,~,\
|
||||
endif
|
||||
call search("^third")
|
||||
call search("name")
|
||||
call assert_equal("URL:\\\\machine.name\\vimtest2c", expand("<cfile>"))
|
||||
call search("^fourth")
|
||||
call search("URL")
|
||||
call assert_equal("URL:\\\\machine.name\\tmp\\vimtest2d", expand("<cfile>"))
|
||||
|
||||
set isf&vim
|
||||
enew!
|
||||
endfunction
|
34
src/testdir/test_hlsearch.vim
Normal file
34
src/testdir/test_hlsearch.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" Test for v:hlsearch
|
||||
|
||||
function! Test_hlsearch()
|
||||
new
|
||||
call setline(1, repeat(['aaa'], 10))
|
||||
set hlsearch nolazyredraw
|
||||
let r=[]
|
||||
" redraw is needed to make hlsearch highlight the matches
|
||||
exe "normal! /aaa\<CR>" | redraw
|
||||
let r1 = screenattr(1, 1)
|
||||
nohlsearch | redraw
|
||||
call assert_notequal(r1, screenattr(1,1))
|
||||
let v:hlsearch=1 | redraw
|
||||
call assert_equal(r1, screenattr(1,1))
|
||||
let v:hlsearch=0 | redraw
|
||||
call assert_notequal(r1, screenattr(1,1))
|
||||
set hlsearch | redraw
|
||||
call assert_equal(r1, screenattr(1,1))
|
||||
let v:hlsearch=0 | redraw
|
||||
call assert_notequal(r1, screenattr(1,1))
|
||||
exe "normal! n" | redraw
|
||||
call assert_equal(r1, screenattr(1,1))
|
||||
let v:hlsearch=0 | redraw
|
||||
call assert_notequal(r1, screenattr(1,1))
|
||||
exe "normal! /\<CR>" | redraw
|
||||
call assert_equal(r1, screenattr(1,1))
|
||||
set nohls
|
||||
exe "normal! /\<CR>" | redraw
|
||||
call assert_notequal(r1, screenattr(1,1))
|
||||
call assert_fails('let v:hlsearch=[]', 'E745')
|
||||
call garbagecollect(1)
|
||||
call getchar(1)
|
||||
enew!
|
||||
endfunction
|
14
src/testdir/test_smartindent.vim
Normal file
14
src/testdir/test_smartindent.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
" Tests for not doing smart indenting when it isn't set.
|
||||
function! Test_nosmartindent()
|
||||
new
|
||||
call append(0, [" some test text",
|
||||
\ " test text",
|
||||
\ "test text",
|
||||
\ " test text"])
|
||||
set nocindent nosmartindent autoindent
|
||||
exe "normal! gg/some\<CR>"
|
||||
exe "normal! 2cc#test\<Esc>"
|
||||
call assert_equal(" #test", getline(1))
|
||||
enew! | close
|
||||
endfunction
|
@@ -23,4 +23,34 @@ func Test_cancel_ptjump()
|
||||
quit
|
||||
endfunc
|
||||
|
||||
" Tests for [ CTRL-I and CTRL-W CTRL-I commands
|
||||
function Test_keyword_jump()
|
||||
call writefile(["#include Xinclude", "",
|
||||
\ "",
|
||||
\ "/* test text test tex start here",
|
||||
\ " some text",
|
||||
\ " test text",
|
||||
\ " start OK if found this line",
|
||||
\ " start found wrong line",
|
||||
\ "test text"], 'Xtestfile')
|
||||
call writefile(["/* test text test tex start here",
|
||||
\ " some text",
|
||||
\ " test text",
|
||||
\ " start OK if found this line",
|
||||
\ " start found wrong line",
|
||||
\ "test text"], 'Xinclude')
|
||||
new Xtestfile
|
||||
call cursor(1,1)
|
||||
call search("start")
|
||||
exe "normal! 5[\<C-I>"
|
||||
call assert_equal(" start OK if found this line", getline('.'))
|
||||
call cursor(1,1)
|
||||
call search("start")
|
||||
exe "normal! 5\<C-W>\<C-I>"
|
||||
call assert_equal(" start OK if found this line", getline('.'))
|
||||
enew! | only
|
||||
call delete('Xtestfile')
|
||||
call delete('Xinclude')
|
||||
endfunction
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
@@ -763,6 +763,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2343,
|
||||
/**/
|
||||
2342,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user