Permalink
Browse files

patch 7.4.2343

Problem:    Too many old file tests.
Solution:   Turn several into new style tests. (Yegappan Lakshmanan)
  • Loading branch information...
1 parent 1b0c1d0 commit 53f1673cd909eb1c809c6a9086e3d104a0df9bed @brammool brammool committed Sep 7, 2016
View
@@ -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:
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -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
View
@@ -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
@@ -2,8 +2,8 @@
function! Test_charsearch()
enew!
call append(0, ['Xabcdefghijkemnopqretuvwxyz',
- \ 'Yabcdefghijkemnopqretuvwxyz',
- \ 'Zabcdefghijkemnokqretkvwxyz'])
+ \ 'Yabcdefghijkemnopqretuvwxyz',
+ \ 'Zabcdefghijkemnokqretkvwxyz'])
" check that "fe" and ";" work
1
normal! ylfep;;p,,p
@@ -6,7 +6,7 @@ function! Test_fnameescape()
try
exe "w! " . fnameescape(fname)
let status = v:true
- endtry
+ endtry
call assert_true(status, "Space")
call delete(fname)
@@ -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
Oops, something went wrong.

0 comments on commit 53f1673

Please sign in to comment.