diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-06 17:11:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-06 17:11:25 +0800 |
commit | c30226c28b44f1eefd495f7345219b62662c0dbc (patch) | |
tree | 486e1e2d9d5809d5cfc041959c777939c0ef3ef6 | |
parent | c6af296cf8e381731f8a233cf89396e0dc7fd4ba (diff) | |
parent | 70843631fe8d2e8e93e6ecf7d08c7824352938b7 (diff) | |
download | rneovim-c30226c28b44f1eefd495f7345219b62662c0dbc.tar.gz rneovim-c30226c28b44f1eefd495f7345219b62662c0dbc.tar.bz2 rneovim-c30226c28b44f1eefd495f7345219b62662c0dbc.zip |
Merge pull request #20962 from zeertzjq/vim-8.2.1736
vim-patch:8.2.{1736,3719,3744}
-rw-r--r-- | src/nvim/testdir/test_autocmd.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_buffer.vim | 13 | ||||
-rw-r--r-- | src/nvim/testdir/test_checkpath.vim | 17 | ||||
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_listdict.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 15 | ||||
-rw-r--r-- | src/nvim/testdir/test_search_stat.vim | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_sort.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_spell.vim | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_substitute.vim | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_syntax.vim | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_tagjump.vim | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_user_func.vim | 3 |
14 files changed, 68 insertions, 6 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim index 50904bab34..1488fe8431 100644 --- a/src/nvim/testdir/test_autocmd.vim +++ b/src/nvim/testdir/test_autocmd.vim @@ -2865,6 +2865,7 @@ func Test_autocmd_invalid_args() call assert_fails('doautocmd * BufEnter', 'E217:') call assert_fails('augroup! x1a2b3', 'E367:') call assert_fails('autocmd BufNew <buffer=999> pwd', 'E680:') + call assert_fails('autocmd BufNew \) set ff=unix', 'E55:') endfunc " Test for deep nesting of autocmds diff --git a/src/nvim/testdir/test_buffer.vim b/src/nvim/testdir/test_buffer.vim index 27c2d5d442..d8d22ff872 100644 --- a/src/nvim/testdir/test_buffer.vim +++ b/src/nvim/testdir/test_buffer.vim @@ -147,6 +147,7 @@ func Test_bdelete_cmd() %bwipe! call assert_fails('bdelete 5', 'E516:') call assert_fails('1,1bdelete 1 2', 'E488:') + call assert_fails('bdelete \)', 'E55:') " Deleting a unlisted and unloaded buffer edit Xfile1 @@ -401,12 +402,12 @@ func Test_buffer_scheme() set noshellslash %bwipe! let bufnames = [ - \ #{id: 'b0', name: 'test://xyz/foo/b0' , match: 1}, - \ #{id: 'b1', name: 'test+abc://xyz/foo/b1', match: 0}, - \ #{id: 'b2', name: 'test_abc://xyz/foo/b2', match: 0}, - \ #{id: 'b3', name: 'test-abc://xyz/foo/b3', match: 1}, - \ #{id: 'b4', name: '-test://xyz/foo/b4' , match: 0}, - \ #{id: 'b5', name: 'test-://xyz/foo/b5' , match: 0}, + \ #{id: 'ssb0', name: 'test://xyz/foo/ssb0' , match: 1}, + \ #{id: 'ssb1', name: 'test+abc://xyz/foo/ssb1', match: 0}, + \ #{id: 'ssb2', name: 'test_abc://xyz/foo/ssb2', match: 0}, + \ #{id: 'ssb3', name: 'test-abc://xyz/foo/ssb3', match: 1}, + \ #{id: 'ssb4', name: '-test://xyz/foo/ssb4' , match: 0}, + \ #{id: 'ssb5', name: 'test-://xyz/foo/ssb5' , match: 0}, \] for buf in bufnames new `=buf.name` diff --git a/src/nvim/testdir/test_checkpath.vim b/src/nvim/testdir/test_checkpath.vim index eff30cf205..f6a3bbce08 100644 --- a/src/nvim/testdir/test_checkpath.vim +++ b/src/nvim/testdir/test_checkpath.vim @@ -102,3 +102,20 @@ func Test_checkpath3() set include& set includeexpr& endfunc + +" Test for invalid regex in 'include' and 'define' options +func Test_checkpath_errors() + let save_include = &include + set include=\\%( + call assert_fails('checkpath', 'E53:') + let &include = save_include + + let save_define = &define + set define=\\%( + call assert_fails('dsearch abc', 'E53:') + let &define = save_define + + call assert_fails('psearch \%(', 'E53:') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index c00172ed68..7cef3117c2 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -316,6 +316,8 @@ func Test_map_completion() unmap <Left> " set cpo-=k + call assert_fails('call feedkeys(":map \\\\%(\<Tab>\<Home>\"\<CR>", "xt")', 'E53:') + unmap <Middle>x set cpo&vim endfunc diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 743022ece4..b464f6591d 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -941,6 +941,7 @@ func Test_match_func() call assert_equal(4, match('testing', 'ing', -1)) call assert_fails("let x=match('testing', 'ing', 0, [])", 'E745:') call assert_equal(-1, match(v:_null_list, 2)) + call assert_equal(-1, match('abc', '\\%(')) endfunc func Test_matchend() diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim index 3d90222b90..7ea488f41d 100644 --- a/src/nvim/testdir/test_listdict.vim +++ b/src/nvim/testdir/test_listdict.vim @@ -754,6 +754,7 @@ func Test_str_split() call assert_equal(['', 'a', '', 'b', '', 'c', ''], split('abc', '\zs', 1)) call assert_fails("call split('abc', [])", 'E730:') call assert_fails("call split('abc', 'b', [])", 'E745:') + call assert_equal(['abc'], split('abc', '\\%(')) endfunc " compare recursively linked list and dict diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 3916d7c554..d689ece70d 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -157,6 +157,20 @@ func Test_path_keep_commas() set path& endfunc +func Test_path_too_long() + exe 'set path=' .. repeat('x', 10000) + call assert_fails('find x', 'E854:') + set path& +endfunc + +func Test_signcolumn() + CheckFeature signs + call assert_equal("auto", &signcolumn) + set signcolumn=yes + set signcolumn=no + call assert_fails('set signcolumn=nope') +endfunc + func Test_filetype_valid() set ft=valid_name call assert_equal("valid_name", &filetype) @@ -399,6 +413,7 @@ func Test_set_errors() call assert_fails('set pyxversion=6', 'E474:') endif call assert_fails("let &tabstop='ab'", 'E521:') + call assert_fails('set spellcapcheck=%\\(', 'E54:') call assert_fails('set sessionoptions=curdir,sesdir', 'E474:') call assert_fails('set foldmarker={{{,', 'E474:') call assert_fails('set sessionoptions=sesdir,curdir', 'E474:') diff --git a/src/nvim/testdir/test_search_stat.vim b/src/nvim/testdir/test_search_stat.vim index 89e09cf85b..77bd50ada2 100644 --- a/src/nvim/testdir/test_search_stat.vim +++ b/src/nvim/testdir/test_search_stat.vim @@ -260,6 +260,14 @@ endfunc func Test_searchcount_fails() call assert_fails('echo searchcount("boo!")', 'E715:') + call assert_fails('echo searchcount({"timeout" : []})', 'E745:') + call assert_fails('echo searchcount({"maxcount" : []})', 'E745:') + call assert_fails('echo searchcount({"pattern" : []})', 'E730:') + call assert_fails('echo searchcount({"pos" : 1})', 'E475:') + call assert_fails('echo searchcount({"pos" : [1]})', 'E475:') + call assert_fails('echo searchcount({"pos" : [[], 2, 3]})', 'E745:') + call assert_fails('echo searchcount({"pos" : [1, [], 3]})', 'E745:') + call assert_fails('echo searchcount({"pos" : [1, 2, []]})', 'E745:') endfunc func Test_searchcount_in_statusline() diff --git a/src/nvim/testdir/test_sort.vim b/src/nvim/testdir/test_sort.vim index f9cbcbb55f..534393b724 100644 --- a/src/nvim/testdir/test_sort.vim +++ b/src/nvim/testdir/test_sort.vim @@ -1361,6 +1361,7 @@ func Test_sort_cmd() call assert_fails('sort no', 'E474:') call assert_fails('sort c', 'E475:') call assert_fails('sort #pat%', 'E654:') + call assert_fails('sort /\%(/', 'E53:') enew! endfunc diff --git a/src/nvim/testdir/test_spell.vim b/src/nvim/testdir/test_spell.vim index d8495fdb9b..ea18fc5194 100644 --- a/src/nvim/testdir/test_spell.vim +++ b/src/nvim/testdir/test_spell.vim @@ -329,6 +329,11 @@ func Test_spellsuggest() call assert_equal(['Third'], spellsuggest('THird', 1)) call assert_equal(['All'], spellsuggest('ALl', 1)) + " Special suggestion for repeated 'the the'. + call assert_inrange(0, 2, index(spellsuggest('the the', 3), 'the')) + call assert_inrange(0, 2, index(spellsuggest('the the', 3), 'the')) + call assert_inrange(0, 2, index(spellsuggest('The the', 3), 'The')) + call assert_fails("call spellsuggest('maxch', [])", 'E745:') call assert_fails("call spellsuggest('maxch', 2, [])", 'E745:') diff --git a/src/nvim/testdir/test_substitute.vim b/src/nvim/testdir/test_substitute.vim index 5b476ddd7f..5fd30c7da7 100644 --- a/src/nvim/testdir/test_substitute.vim +++ b/src/nvim/testdir/test_substitute.vim @@ -457,6 +457,7 @@ func Test_substitute_errors() call assert_fails("let s=substitute('abcda', [], 'A', 'g')", 'E730:') call assert_fails("let s=substitute('abcda', 'a', [], 'g')", 'E730:') call assert_fails("let s=substitute('abcda', 'a', 'A', [])", 'E730:') + call assert_fails("let s=substitute('abc', '\\%(', 'A', 'g')", 'E53:') bwipe! endfunc diff --git a/src/nvim/testdir/test_syntax.vim b/src/nvim/testdir/test_syntax.vim index 9d108c6ca2..45230c4208 100644 --- a/src/nvim/testdir/test_syntax.vim +++ b/src/nvim/testdir/test_syntax.vim @@ -407,6 +407,7 @@ func Test_syntax_invalid_arg() call AssertFails('syntax cluster contains=Abc', 'E400:') call AssertFails("syntax match Character /'.'", 'E401:') call AssertFails("syntax match Character /'.'/a", 'E402:') + call assert_fails('syntax sync linecont /\%(/', 'E53:') call assert_fails('syntax sync linecont /pat', 'E404:') call assert_fails('syntax sync linecont', 'E404:') call assert_fails('syntax sync linecont /pat1/ linecont /pat2/', 'E403:') @@ -416,6 +417,7 @@ func Test_syntax_invalid_arg() call AssertFails('syntax match ccFoo "Foo" nextgroup=ALLBUT,F', 'E407:') call AssertFails('syntax region Block start="{" contains=F,ALLBUT', 'E408:') call AssertFails("syntax match Characters contains=a.*x /'.'/", 'E409:') + call assert_fails('syntax match Search /abc/ contains=ALLBUT,/\%(/', 'E53:') endfunc func Test_syn_sync() diff --git a/src/nvim/testdir/test_tagjump.vim b/src/nvim/testdir/test_tagjump.vim index 61bf9e6d0d..bfc61e7b48 100644 --- a/src/nvim/testdir/test_tagjump.vim +++ b/src/nvim/testdir/test_tagjump.vim @@ -184,6 +184,10 @@ function Test_keyword_jump() call search("start") exe "normal! 5\<C-W>\<C-I>" call assert_equal(" start OK if found this line", getline('.')) + + " invalid tag search pattern + call assert_fails('tag /\%(/', 'E426:') + enew! | only call delete('Xtestfile') call delete('Xinclude') diff --git a/src/nvim/testdir/test_user_func.vim b/src/nvim/testdir/test_user_func.vim index 7aa21d7816..f13c082814 100644 --- a/src/nvim/testdir/test_user_func.vim +++ b/src/nvim/testdir/test_user_func.vim @@ -413,6 +413,9 @@ func Test_func_def_error() call writefile(['func foo#Bar()', 'return 1', 'endfunc'], 'Xscript') call assert_fails('source Xscript', 'E746:') call delete('Xscript') + + " Try to list functions using an invalid search pattern + call assert_fails('function /\%(/', 'E53:') endfunc " Test for deleting a function |