Patch 8.2.3281 Problem: Vim9: TODO items in tests can be taken care of. Solution: Update test for now working functionality. (closes #8694) Files: src/testdir/test_vim9_assign.vim, src/testdir/test_vim9_func.vim, src/testdir/test_vim9_script.vim
*** ../vim-8.2.3280/src/testdir/test_vim9_assign.vim 2021-08-02 21:55:08.430701260 +0200 --- src/testdir/test_vim9_assign.vim 2021-08-03 20:55:56.203554690 +0200 *************** *** 1228,1249 **** 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) END ! CheckScriptSuccess(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) --- 1228,1237 ---- 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) 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) *** ../vim-8.2.3280/src/testdir/test_vim9_func.vim 2021-08-01 15:40:24.648232770 +0200 --- src/testdir/test_vim9_func.vim 2021-08-03 20:59:45.747171946 +0200 *************** *** 2250,2264 **** 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 }) enddef ! assert_equal('--there', F('unused')('there')('--')) END CheckScriptSuccess(lines) --- 2250,2263 ---- enddef def Test_nested_inline_lambda() 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 .. text }) enddef ! assert_equal('--there++', F('++')('there')('--')) END CheckScriptSuccess(lines) *** ../vim-8.2.3280/src/testdir/test_vim9_script.vim 2021-08-01 21:19:40.130538381 +0200 --- src/testdir/test_vim9_script.vim 2021-08-03 21:01:22.958997897 +0200 *************** *** 188,195 **** var varlist = [7, 8] const constlist = [1, varlist, 3] varlist[0] = 77 ! # TODO: does not work yet ! # constlist[1][1] = 88 var cl = constlist[1] cl[1] = 88 constlist->assert_equal([1, [77, 88], 3]) --- 188,194 ---- var varlist = [7, 8] const constlist = [1, varlist, 3] varlist[0] = 77 ! constlist[1][1] = 88 var cl = constlist[1] cl[1] = 88 constlist->assert_equal([1, [77, 88], 3]) *************** *** 197,204 **** 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 var cd = constdict['two'] cd['six'] = 66 constdict->assert_equal({one: 1, two: {five: 55, six: 66}, three: 3}) --- 196,202 ---- var vardict = {five: 5, six: 6} const constdict = {one: 1, two: vardict, three: 3} vardict['five'] = 55 ! constdict['two']['six'] = 66 var cd = constdict['two'] cd['six'] = 66 constdict->assert_equal({one: 1, two: {five: 55, six: 66}, three: 3}) *** ../vim-8.2.3280/src/version.c 2021-08-03 18:33:04.655157857 +0200 --- src/version.c 2021-08-03 18:56:33.835943586 +0200 *************** *** 757,758 **** --- 757,760 ---- { /* Add new patch number below this line */ + /**/ + 3281, /**/ -- Overflow on /dev/null, please empty the bit bucket. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202108031916.173JGrTY852946%40masaka.moolenaar.net.