]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.3853: Vim9: not enough tests v8.2.3853
authorBram Moolenaar <Bram@vim.org>
Sun, 19 Dec 2021 17:27:06 +0000 (17:27 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 19 Dec 2021 17:27:06 +0000 (17:27 +0000)
Problem:    Vim9: not enough tests.
Solution:   Run more existing tests for Vim9 script.

src/testdir/test_listdict.vim
src/version.c

index ad36cb0bdf53741d50bb7a681f360d1eb96a39f9..28cd55b29561e6f105bfea2e598be759b41431e4 100644 (file)
@@ -1294,29 +1294,27 @@ func Test_listdict_index()
   call CheckLegacyAndVim9Failure(['echo function("min")[0]'], 'E695:')
   call CheckLegacyAndVim9Failure(['echo v:true[0]'], 'E909:')
   call CheckLegacyAndVim9Failure(['echo v:null[0]'], 'E909:')
-
-  let d = {'k' : 10}
-  call assert_fails('echo d.', 'E15:')
-  call CheckDefAndScriptFailure2(['var d = {k: 10}', 'echo d.'], 'E1127', 'E15:')
-
+  call CheckLegacyAndVim9Failure(['VAR d = {"k": 10}', 'echo d.'], ['E15:', 'E1127:', 'E15:'])
   call CheckLegacyAndVim9Failure(['VAR d = {"k": 10}', 'echo d[1 : 2]'], 'E719:')
 
   call assert_fails("let v = [4, 6][{-> 1}]", 'E729:')
   call CheckDefAndScriptFailure2(['var v = [4, 6][() => 1]'], 'E1012', 'E703:')
 
-  call assert_fails("let v = range(5)[2:[]]", 'E730:')
+  call CheckLegacyAndVim9Failure(['VAR v = range(5)[2 : []]'], ['E730:', 'E1012:', 'E730:'])
+
   call assert_fails("let v = range(5)[2:{-> 2}(]", ['E15:', 'E116:'])
-  call assert_fails("let v = range(5)[2:3", 'E111:')
-  call assert_fails("let l = insert([1,2,3], 4, 10)", 'E684:')
-  call assert_fails("let l = insert([1,2,3], 4, -10)", 'E684:')
-  call assert_fails("let l = insert([1,2,3], 4, [])", 'E745:')
-  let l = [1, 2, 3]
-  call assert_fails("let l[i] = 3", 'E121:')
-  call assert_fails("let l[1.1] = 4", 'E805:')
-  call assert_fails("let l[:i] = [4, 5]", 'E121:')
-  call assert_fails("let l[:3.2] = [4, 5]", 'E805:')
-  let t = test_unknown()
-  call assert_fails("echo t[0]", 'E685:')
+  call CheckDefAndScriptFailure(['var v = range(5)[2 : () => 2(]'], 'E15:')
+
+  call CheckLegacyAndVim9Failure(['VAR v = range(5)[2 : 3'], ['E111:', 'E1097:', 'E111:'])
+  call CheckLegacyAndVim9Failure(['VAR l = insert([1, 2, 3], 4, 10)'], 'E684:')
+  call CheckLegacyAndVim9Failure(['VAR l = insert([1, 2, 3], 4, -10)'], 'E684:')
+  call CheckLegacyAndVim9Failure(['VAR l = insert([1, 2, 3], 4, [])'], ['E745:', 'E1013:', 'E1210:'])
+
+  call CheckLegacyAndVim9Failure(['VAR l = [1, 2, 3]', 'LET l[i] = 3'], ['E121:', 'E1001:', 'E121:'])
+  call CheckLegacyAndVim9Failure(['VAR l = [1, 2, 3]', 'LET l[1.1] = 4'], ['E805:', 'E1012:', 'E805:'])
+  call CheckLegacyAndVim9Failure(['VAR l = [1, 2, 3]', 'LET l[: i] = [4, 5]'], ['E121:', 'E1001:', 'E121:'])
+  call CheckLegacyAndVim9Failure(['VAR l = [1, 2, 3]', 'LET l[: 3.2] = [4, 5]'], ['E805:', 'E1012:', 'E805:'])
+  call CheckLegacyAndVim9Failure(['VAR t = test_unknown()', 'echo t[0]'], 'E685:')
 endfunc
 
 " Test for a null list
index 288b23a016e2d7cb15598fc3cccc78055b69013b..0e41ec6a2dcd27326fa3a2c9ea1fc3c521a929ff 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3853,
 /**/
     3852,
 /**/