To: vim_dev@googlegroups.com Subject: Patch 8.2.4601 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4601 Problem: Vim9: not enough test coverage for executing :def function. Solution: Add a few more tests. Files: src/testdir/test_vim9_script.vim, src/testdir/test_vim9_func.vim, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.4600/src/testdir/test_vim9_script.vim 2022-03-18 13:10:45.403445014 +0000 --- src/testdir/test_vim9_script.vim 2022-03-20 18:05:19.892966316 +0000 *************** *** 2003,2008 **** --- 2003,2014 ---- endfor assert_equal(6, total) + total = 0 + for b in 0z010203 + total += b + endfor + assert_equal(6, total) + var chars = '' for s: string in 'foobar' chars ..= s *** ../vim-8.2.4600/src/testdir/test_vim9_func.vim 2022-03-17 16:30:00.174908142 +0000 --- src/testdir/test_vim9_func.vim 2022-03-20 18:28:19.532020496 +0000 *************** *** 4085,4090 **** --- 4085,4103 ---- EOF assert_equal('val', g:d.key) enddef + + def Test_lua_heredoc_fails() + var lines = [ + 'vim9script', + 'def ExeLua()', + 'lua << trim EOLUA', + "x = vim.eval('g:nodict')", + 'EOLUA', + 'enddef', + 'ExeLua()', + ] + v9.CheckScriptFailure(lines, 'E121: Undefined variable: g:nodict') + enddef endif *** ../vim-8.2.4600/src/testdir/test_vim9_cmd.vim 2022-03-20 17:46:01.797053490 +0000 --- src/testdir/test_vim9_cmd.vim 2022-03-20 18:50:07.508406953 +0000 *************** *** 1660,1665 **** --- 1660,1667 ---- v9.CheckDefFailure(['s/from/\="x")/'], 'E488:') v9.CheckDefFailure(['s/from/\="x"/9'], 'E488:') + v9.CheckDefExecFailure(['s/this/\="that"/'], 'E486:') + # When calling a function the right instruction list needs to be restored. g:cond = true var lines =<< trim END *** ../vim-8.2.4600/src/version.c 2022-03-20 17:46:01.801053498 +0000 --- src/version.c 2022-03-20 18:06:11.256920494 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4601, /**/ -- CONCORDE: Message for you, sir. He falls forward revealing the arrow with the note. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///