]> granicus.if.org Git - vim/commitdiff
patch 8.2.3281: Vim9: TODO items in tests can be taken care of v8.2.3281
authorBram Moolenaar <Bram@vim.org>
Tue, 3 Aug 2021 19:16:18 +0000 (21:16 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 3 Aug 2021 19:16:18 +0000 (21:16 +0200)
Problem:    Vim9: TODO items in tests can be taken care of.
Solution:   Update test for now working functionality. (closes #8694)

src/testdir/test_vim9_assign.vim
src/testdir/test_vim9_func.vim
src/testdir/test_vim9_script.vim
src/version.c

index fa2654801879a1e9e7eecf530b820d85f0905566..428de1c1358765bcf651ddf44a9e3c2820baa1f3 100644 (file)
@@ -1228,22 +1228,10 @@ def Test_assign_dict()
 
       d.somekey = 'someval'
       assert_equal({key: 'value', '123': 'qwerty', somekey: 'someval'}, d)
-      # unlet d.somekey
-      # assert_equal({key: 'value', '123': 'qwerty'}, d)
-  END
-  CheckDefAndScriptSuccess(lines)
-
-  # TODO: move to above once "unlet d.somekey" in :def is implemented
-  lines =<< trim END
-      vim9script
-      var d: dict<string> = {}
-      d['key'] = 'value'
-      d.somekey = 'someval'
-      assert_equal({key: 'value', somekey: 'someval'}, d)
       unlet d.somekey
-      assert_equal({key: 'value'}, d)
+      assert_equal({key: 'value', '123': 'qwerty'}, d)
   END
-  CheckScriptSuccess(lines)
+  CheckDefAndScriptSuccess(lines)
 
   CheckDefFailure(["var d: dict<number> = {a: '', b: true}"], 'E1012: Type mismatch; expected dict<number> but got dict<any>', 1)
   CheckDefFailure(["var d: dict<dict<number>> = {x: {a: '', b: true}}"], 'E1012: Type mismatch; expected dict<dict<number>> but got dict<dict<any>>', 1)
index 7e7ce35325fdc8ea298f0452cbac0d2ae8aa1ef1..5fdd717924bb1f1c019021198fc762e192b35d1b 100644 (file)
@@ -2250,15 +2250,14 @@ def Test_double_nested_lambda()
 enddef
 
 def Test_nested_inline_lambda()
-  # TODO: use the "text" argument
   var lines =<< trim END
       vim9script
       def F(text: string): func(string): func(string): string
         return (arg: string): func(string): string => ((sep: string): string => {
-            return sep .. arg
+            return sep .. arg .. text
           })
       enddef
-      assert_equal('--there', F('unused')('there')('--'))
+      assert_equal('--there++', F('++')('there')('--'))
   END
   CheckScriptSuccess(lines)
 
index 9f99ebbd4449980f2265b0de9819716b40df8056..b11149a59e53aff309a8231e9748e65a9ce62875 100644 (file)
@@ -188,8 +188,7 @@ def Test_const()
     var varlist = [7, 8]
     const constlist = [1, varlist, 3]
     varlist[0] = 77
-    # TODO: does not work yet
-    # constlist[1][1] = 88
+    constlist[1][1] = 88
     var cl = constlist[1]
     cl[1] = 88
     constlist->assert_equal([1, [77, 88], 3])
@@ -197,8 +196,7 @@ def Test_const()
     var vardict = {five: 5, six: 6}
     const constdict = {one: 1, two: vardict, three: 3}
     vardict['five'] = 55
-    # TODO: does not work yet
-    # constdict['two']['six'] = 66
+    constdict['two']['six'] = 66
     var cd = constdict['two']
     cd['six'] = 66
     constdict->assert_equal({one: 1, two: {five: 55, six: 66}, three: 3})
index 32403f45c860ef540280133e8b25e8f0b19eb1dc..251f26f111a9ea9da6c40a4af7686e0fc4395c5d 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3281,
 /**/
     3280,
 /**/