To: vim_dev@googlegroups.com Subject: Patch 8.2.4373 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4373 Problem: Expression test fails. Solution: Make the test work with latest Vim9 syntax. Files: src/testdir/test_expr.vim *** ../vim-8.2.4372/src/testdir/test_expr.vim 2022-02-12 20:34:47.084825186 +0000 --- src/testdir/test_expr.vim 2022-02-13 20:44:55.977106134 +0000 *************** *** 595,602 **** func Test_function_with_funcref() let lines =<< trim END ! VAR s:F = function('type') ! VAR s:Fref = function(s:F) call assert_equal(v:t_string, s:Fref('x')) call assert_fails("call function('s:F')", 'E700:') --- 595,602 ---- func Test_function_with_funcref() let lines =<< trim END ! let s:F = function('type') ! let s:Fref = function(s:F) call assert_equal(v:t_string, s:Fref('x')) call assert_fails("call function('s:F')", 'E700:') *************** *** 604,620 **** call assert_fails("call function('foo()')", 'foo()') call assert_fails("function('')", 'E129:') ! legacy let s:Len = {s -> strlen(s)} call assert_equal(6, s:Len('foobar')) ! VAR name = string(s:Len) ! #" can evaluate "function('99')" ! call execute('VAR Ref = ' .. name) call assert_equal(4, Ref('text')) END ! call v9.CheckTransLegacySuccess(lines) ! " skip CheckTransDefSuccess(), cannot assign to script variable ! call map(lines, {k, v -> v =~ 'legacy' ? v : substitute(v, 's:', '', 'g')}) ! call v9.CheckTransVim9Success(lines) endfunc func Test_funcref() --- 604,637 ---- call assert_fails("call function('foo()')", 'foo()') call assert_fails("function('')", 'E129:') ! let s:Len = {s -> strlen(s)} call assert_equal(6, s:Len('foobar')) ! let name = string(s:Len) ! " can evaluate "function('99')" ! call execute('let Ref = ' .. name) call assert_equal(4, Ref('text')) END ! call v9.CheckScriptSuccess(lines) ! ! let lines =<< trim END ! vim9script ! var F = function('type') ! var Fref = function(F) ! call assert_equal(v:t_string, Fref('x')) ! call assert_fails("call function('F')", 'E700:') ! ! call assert_fails("call function('foo()')", 'E475:') ! call assert_fails("call function('foo()')", 'foo()') ! call assert_fails("function('')", 'E129:') ! ! var Len = (s) => strlen(s) ! call assert_equal(6, Len('foobar')) ! var name = string(Len) ! # can evaluate "function('99')" ! call execute('var Ref = ' .. name) ! call assert_equal(4, Ref('text')) ! END ! call v9.CheckScriptSuccess(lines) endfunc func Test_funcref() *** ../vim-8.2.4372/src/version.c 2022-02-13 20:31:20.849858637 +0000 --- src/version.c 2022-02-13 20:45:48.425052792 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4373, /**/ -- I wonder how much deeper the ocean would be without sponges. /// Bram Moolenaar -- Bram@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 ///