aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-25 21:32:12 +0800
committerGitHub <noreply@github.com>2023-04-25 21:32:12 +0800
commit43c49746d9cf82dba0d56b07d39722f9ebeecf90 (patch)
tree3d7f3aeb8522e11b55fc5ac296c9c13d370933e1 /test
parent2e8410b7be9dce7e5fa12a442e19d548bfb260bc (diff)
downloadrneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.tar.gz
rneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.tar.bz2
rneovim-43c49746d9cf82dba0d56b07d39722f9ebeecf90.zip
vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309)
Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009) https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Cherry-pick removal of E922 from docs from patch 9.0.1403. Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_charsearch.vim2
-rw-r--r--test/old/testdir/test_expr.vim2
-rw-r--r--test/old/testdir/test_functions.vim2
-rw-r--r--test/old/testdir/test_listdict.vim2
-rw-r--r--test/old/testdir/test_maparg.vim2
-rw-r--r--test/old/testdir/test_matchfuzzy.vim8
-rw-r--r--test/old/testdir/test_partial.vim2
-rw-r--r--test/old/testdir/test_search_stat.vim2
-rw-r--r--test/old/testdir/test_signs.vim12
-rw-r--r--test/old/testdir/test_tagjump.vim8
-rw-r--r--test/old/testdir/test_timers.vim2
-rw-r--r--test/old/testdir/test_window_cmd.vim6
12 files changed, 24 insertions, 26 deletions
diff --git a/test/old/testdir/test_charsearch.vim b/test/old/testdir/test_charsearch.vim
index f8f3e958ca..8d6b405743 100644
--- a/test/old/testdir/test_charsearch.vim
+++ b/test/old/testdir/test_charsearch.vim
@@ -39,7 +39,7 @@ func Test_charsearch()
call setcharsearch({'char' : ''})
call assert_equal('', getcharsearch().char)
- call assert_fails("call setcharsearch([])", 'E715:')
+ call assert_fails("call setcharsearch([])", 'E1206:')
enew!
endfunc
diff --git a/test/old/testdir/test_expr.vim b/test/old/testdir/test_expr.vim
index dee7266bb5..ff3dfb83cb 100644
--- a/test/old/testdir/test_expr.vim
+++ b/test/old/testdir/test_expr.vim
@@ -105,7 +105,7 @@ func Test_dict()
END
call CheckLegacyAndVim9Success(lines)
- call CheckLegacyAndVim9Failure(["VAR i = has_key([], 'a')"], ['E715:', 'E1013:', 'E1206:'])
+ call CheckLegacyAndVim9Failure(["VAR i = has_key([], 'a')"], ['E1206:', 'E1013:', 'E1206:'])
endfunc
func Test_strgetchar()
diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim
index 7d3d74caad..78eab3aaa5 100644
--- a/test/old/testdir/test_functions.vim
+++ b/test/old/testdir/test_functions.vim
@@ -2007,7 +2007,7 @@ func Test_call()
endfunction
let mydict = {'data': [0, 1, 2, 3], 'len': function("Mylen")}
eval mydict.len->call([], mydict)->assert_equal(4)
- call assert_fails("call call('Mylen', [], 0)", 'E715:')
+ call assert_fails("call call('Mylen', [], 0)", 'E1206:')
call assert_fails('call foo', 'E107:')
" These once caused a crash.
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim
index cbed71bb0a..0ff3582da9 100644
--- a/test/old/testdir/test_listdict.vim
+++ b/test/old/testdir/test_listdict.vim
@@ -699,7 +699,7 @@ func Test_reverse_sort_uniq()
call assert_fails('call reverse("")', 'E899:')
call assert_fails('call uniq([1, 2], {x, y -> []})', 'E745:')
- call assert_fails("call sort([1, 2], function('min'), 1)", "E715:")
+ call assert_fails("call sort([1, 2], function('min'), 1)", "E1206:")
call assert_fails("call sort([1, 2], function('invalid_func'))", "E700:")
call assert_fails("call sort([1, 2], function('min'))", "E118:")
endfunc
diff --git a/test/old/testdir/test_maparg.vim b/test/old/testdir/test_maparg.vim
index 19130c1569..12670671dd 100644
--- a/test/old/testdir/test_maparg.vim
+++ b/test/old/testdir/test_maparg.vim
@@ -270,7 +270,7 @@ func Test_mapset()
bwipe!
call assert_fails('call mapset([], v:false, {})', 'E730:')
- call assert_fails('call mapset("i", 0, "")', 'E715:')
+ call assert_fails('call mapset("i", 0, "")', 'E1206:')
call assert_fails('call mapset("i", 0, {})', 'E460:')
endfunc
diff --git a/test/old/testdir/test_matchfuzzy.vim b/test/old/testdir/test_matchfuzzy.vim
index b46550fbc3..be5c629cf5 100644
--- a/test/old/testdir/test_matchfuzzy.vim
+++ b/test/old/testdir/test_matchfuzzy.vim
@@ -67,7 +67,7 @@ func Test_matchfuzzy()
call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'key' : 'val'}))
call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> v.val}}))
call assert_equal([], matchfuzzy(l, 'day', {'key' : 'val'}))
- call assert_fails("let x = matchfuzzy(l, 'cam', 'random')", 'E715:')
+ call assert_fails("let x = matchfuzzy(l, 'cam', 'random')", 'E1206:')
call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> []}}))
call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> 1}}))
call assert_fails("let x = matchfuzzy(l, 'day', {'text_cb' : {a, b -> 1}})", 'E119:')
@@ -76,7 +76,7 @@ func Test_matchfuzzy()
" call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 'E921:')
call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 'E6000:')
call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : []})", 'E730:')
- call assert_fails("let x = matchfuzzy(l, 'cam', v:_null_dict)", 'E715:')
+ call assert_fails("let x = matchfuzzy(l, 'cam', v:_null_dict)", 'E1297:')
call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : v:_null_string})", 'E475:')
" Nvim doesn't have null functions
" call assert_fails("let x = matchfuzzy(l, 'foo', {'text_cb' : test_null_function()})", 'E475:')
@@ -144,7 +144,7 @@ func Test_matchfuzzypos()
\ matchfuzzypos(l, 'cam', {'key' : 'val'}))
call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> v.val}}))
call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'key' : 'val'}))
- call assert_fails("let x = matchfuzzypos(l, 'cam', 'random')", 'E715:')
+ call assert_fails("let x = matchfuzzypos(l, 'cam', 'random')", 'E1206:')
call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> []}}))
call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> 1}}))
call assert_fails("let x = matchfuzzypos(l, 'day', {'text_cb' : {a, b -> 1}})", 'E119:')
@@ -153,7 +153,7 @@ func Test_matchfuzzypos()
" call assert_fails("let x = matchfuzzypos(l, 'cam', {'text_cb' : []})", 'E921:')
call assert_fails("let x = matchfuzzypos(l, 'cam', {'text_cb' : []})", 'E6000:')
call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : []})", 'E730:')
- call assert_fails("let x = matchfuzzypos(l, 'cam', v:_null_dict)", 'E715:')
+ call assert_fails("let x = matchfuzzypos(l, 'cam', v:_null_dict)", 'E1297:')
call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : v:_null_string})", 'E475:')
" Nvim doesn't have null functions
" call assert_fails("let x = matchfuzzypos(l, 'foo', {'text_cb' : test_null_function()})", 'E475:')
diff --git a/test/old/testdir/test_partial.vim b/test/old/testdir/test_partial.vim
index 302bc22d93..8b62e4a0e5 100644
--- a/test/old/testdir/test_partial.vim
+++ b/test/old/testdir/test_partial.vim
@@ -86,7 +86,7 @@ func Test_partial_dict()
call assert_equal("Hello", dict.tr())
call assert_fails("let F=function('setloclist', 10)", "E923:")
- call assert_fails("let F=function('setloclist', [], [])", "E922:")
+ call assert_fails("let F=function('setloclist', [], [])", "E1206:")
endfunc
func Test_partial_implicit()
diff --git a/test/old/testdir/test_search_stat.vim b/test/old/testdir/test_search_stat.vim
index 1b2d854829..8dfc850956 100644
--- a/test/old/testdir/test_search_stat.vim
+++ b/test/old/testdir/test_search_stat.vim
@@ -259,7 +259,7 @@ func Test_search_stat()
endfunc
func Test_searchcount_fails()
- call assert_fails('echo searchcount("boo!")', 'E715:')
+ call assert_fails('echo searchcount("boo!")', 'E1206:')
call assert_fails('echo searchcount({"timeout" : []})', 'E745:')
call assert_fails('echo searchcount({"maxcount" : []})', 'E745:')
call assert_fails('echo searchcount({"pattern" : []})', 'E730:')
diff --git a/test/old/testdir/test_signs.vim b/test/old/testdir/test_signs.vim
index 129f1c1a0c..9ecbde0f30 100644
--- a/test/old/testdir/test_signs.vim
+++ b/test/old/testdir/test_signs.vim
@@ -463,7 +463,7 @@ func Test_sign_funcs()
call assert_fails('call sign_define("sign4", {"text" : "===>"})', 'E239:')
" call assert_fails('call sign_define("sign5", {"text" : ""})', 'E239:')
call assert_fails('call sign_define({})', 'E731:')
- call assert_fails('call sign_define("sign6", [])', 'E715:')
+ call assert_fails('call sign_define("sign6", [])', 'E1206:')
" Tests for sign_getdefined()
call assert_equal([], sign_getdefined("none"))
@@ -490,8 +490,7 @@ func Test_sign_funcs()
" Tests for invalid arguments to sign_place()
call assert_fails('call sign_place([], "", "mySign", 1)', 'E745:')
call assert_fails('call sign_place(5, "", "mySign", -1)', 'E158:')
- call assert_fails('call sign_place(-1, "", "sign1", "Xsign", [])',
- \ 'E715:')
+ call assert_fails('call sign_place(-1, "", "sign1", "Xsign", [])', 'E1206:')
call assert_fails('call sign_place(-1, "", "sign1", "Xsign",
\ {"lnum" : 30})', 'E474:')
call assert_fails('call sign_place(10, "", "xsign1x", "Xsign",
@@ -526,7 +525,7 @@ func Test_sign_funcs()
call assert_fails("call sign_getplaced('dummy.sign')", 'E158:')
call assert_fails('call sign_getplaced("&")', 'E158:')
call assert_fails('call sign_getplaced(-1)', 'E158:')
- call assert_fails('call sign_getplaced("Xsign", [])', 'E715:')
+ call assert_fails('call sign_getplaced("Xsign", [])', 'E1206:')
call assert_equal([{'bufnr' : bufnr(''), 'signs' : []}],
\ sign_getplaced('Xsign', {'lnum' : 1000000}))
call assert_fails("call sign_getplaced('Xsign', {'lnum' : []})",
@@ -549,7 +548,7 @@ func Test_sign_funcs()
\ {'id' : 20, 'buffer' : '&'})", 'E158:')
call assert_fails("call sign_unplace('g1',
\ {'id' : 20, 'buffer' : 200})", 'E158:')
- call assert_fails("call sign_unplace('g1', 'mySign')", 'E715:')
+ call assert_fails("call sign_unplace('g1', 'mySign')", 'E1206:')
call sign_unplace('*')
@@ -1568,8 +1567,7 @@ func Test_sign_priority()
\ s[0].signs)
" Error case
- call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign',
- \ [])", 'E715:')
+ call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign', [])", 'E1206:')
call assert_fails("call sign_place(1, 'g1', 'sign1', 'Xsign',
\ {'priority' : []})", 'E745:')
call sign_unplace('*')
diff --git a/test/old/testdir/test_tagjump.vim b/test/old/testdir/test_tagjump.vim
index be60a3535c..3c646048f5 100644
--- a/test/old/testdir/test_tagjump.vim
+++ b/test/old/testdir/test_tagjump.vim
@@ -405,10 +405,10 @@ func Test_getsettagstack()
" Error cases
call assert_equal({}, gettagstack(100))
call assert_equal(-1, settagstack(100, {'items' : []}))
- call assert_fails('call settagstack(1, [1, 10])', 'E715')
- call assert_fails("call settagstack(1, {'items' : 10})", 'E714')
- call assert_fails("call settagstack(1, {'items' : []}, 10)", 'E928')
- call assert_fails("call settagstack(1, {'items' : []}, 'b')", 'E962')
+ call assert_fails('call settagstack(1, [1, 10])', 'E1206:')
+ call assert_fails("call settagstack(1, {'items' : 10})", 'E714:')
+ call assert_fails("call settagstack(1, {'items' : []}, 10)", 'E928:')
+ call assert_fails("call settagstack(1, {'items' : []}, 'b')", 'E962:')
call assert_equal(-1, settagstack(0, v:_null_dict))
set tags=Xtags
diff --git a/test/old/testdir/test_timers.vim b/test/old/testdir/test_timers.vim
index f94ee6c9f3..aa766fff40 100644
--- a/test/old/testdir/test_timers.vim
+++ b/test/old/testdir/test_timers.vim
@@ -228,7 +228,7 @@ func Test_timer_errors()
sleep 50m
call assert_equal(3, g:call_count)
- call assert_fails('call timer_start(100, "MyHandler", "abc")', 'E475:')
+ call assert_fails('call timer_start(100, "MyHandler", "abc")', 'E1206:')
call assert_fails('call timer_start(100, [])', 'E921:')
call assert_fails('call timer_stop("abc")', 'E39:')
endfunc
diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim
index 88135199fe..9320d67498 100644
--- a/test/old/testdir/test_window_cmd.vim
+++ b/test/old/testdir/test_window_cmd.vim
@@ -735,7 +735,7 @@ func Test_relative_cursor_position_in_one_line_window()
only!
bwipe!
- call assert_fails('call winrestview(v:_null_dict)', 'E474:')
+ call assert_fails('call winrestview(v:_null_dict)', 'E1297:')
endfunc
func Test_relative_cursor_position_after_move_and_resize()
@@ -936,7 +936,7 @@ func Test_winrestview()
call assert_equal(view, winsaveview())
bwipe!
- call assert_fails('call winrestview(v:_null_dict)', 'E474:')
+ call assert_fails('call winrestview(v:_null_dict)', 'E1297:')
endfunc
func Test_win_splitmove()
@@ -967,7 +967,7 @@ func Test_win_splitmove()
call assert_equal(bufname(winbufnr(2)), 'b')
call assert_equal(bufname(winbufnr(3)), 'a')
call assert_equal(bufname(winbufnr(4)), 'd')
- call assert_fails('call win_splitmove(winnr(), winnr("k"), v:_null_dict)', 'E474:')
+ call assert_fails('call win_splitmove(winnr(), winnr("k"), v:_null_dict)', 'E1297:')
only | bd
call assert_fails('call win_splitmove(winnr(), 123)', 'E957:')