vim-patch:7.4.2343 and mark NA patches (#6384)

vim-patch:7.4.2343

Problem:    Too many old file tests.
Solution:   Turn several into new style tests. (Yegappan Lakshmanan)

53f1673cd9
This commit is contained in:
lonerover
2017-03-29 07:30:54 +08:00
committed by Justin M. Keyes
parent b9e7ab1484
commit e86042ae17
9 changed files with 149 additions and 6 deletions

View File

@@ -41,10 +41,12 @@ NEW_TESTS ?= \
test_fnameescape.res \
test_fold.res \
test_glob2regpat.res \
test_gf.res \
test_gn.res \
test_hardcopy.res \
test_help_tagjump.res \
test_history.res \
test_hlsearch.res \
test_increment.res \
test_increment_dbcs.res \
test_lambda.res \
@@ -57,6 +59,7 @@ NEW_TESTS ?= \
test_normal.res \
test_quickfix.res \
test_signs.res \
test_smartindent.res \
test_substitute.res \
test_syntax.res \
test_tabpage.res \

View 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

View 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

View 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

View File

@@ -65,4 +65,34 @@ func Test_duplicate_tagjump()
call delete('Xfile1')
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

View File

@@ -74,10 +74,10 @@ static char *features[] = {
// clang-format off
static int included_patches[] = {
// 2367,
// 2367,NA
// 2366 NA
// 2365 NA
// 2364,
// 2364,NA
// 2363 NA
2362,
// 2361 NA
@@ -98,7 +98,7 @@ static int included_patches[] = {
2346,
// 2345 NA
// 2344 NA
// 2343,
2343,
// 2342 NA
2341,
// 2340 NA

View File

@@ -269,4 +269,33 @@ describe('argument list commands', function()
eq(0, eval('argidx()'))
execute('%argd')
end)
it('test for autocommand that redefines the argument list, when doing ":all"', function()
execute('autocmd BufReadPost Xxx2 next Xxx2 Xxx1')
execute("call writefile(['test file Xxx1'], 'Xxx1')")
execute("call writefile(['test file Xxx2'], 'Xxx2')")
execute("call writefile(['test file Xxx3'], 'Xxx3')")
execute('new')
-- redefine arglist; go to Xxx1
execute('next! Xxx1 Xxx2 Xxx3')
-- open window for all args
execute('all')
eq('test file Xxx1', eval('getline(1)'))
execute('wincmd w')
execute('wincmd w')
eq('test file Xxx1', eval('getline(1)'))
-- should now be in Xxx2
execute('rewind')
eq('test file Xxx2', eval('getline(1)'))
execute('autocmd! BufReadPost Xxx2')
execute('enew! | only')
execute("call delete('Xxx1')")
execute("call delete('Xxx2')")
execute("call delete('Xxx3')")
execute('argdelete Xxx*')
execute('bwipe! Xxx1 Xxx2 Xxx3')
end)
end)