To: vim_dev@googlegroups.com Subject: Patch 8.2.2144 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2144 Problem: Vim9: some corner cases not tested. Solution: Add a few tests. Files: src/testdir/test_vim9_script.vim, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.2143/src/testdir/test_vim9_script.vim 2020-12-13 17:50:16.734956500 +0100 --- src/testdir/test_vim9_script.vim 2020-12-14 18:24:26.104352109 +0100 *************** *** 23,28 **** --- 23,33 ---- list assert_equal('three$', Screenline(&lines)) bwipe! + + # won't generate anything + if false + :123 + endif enddef let g:alist = [7] *************** *** 1890,1895 **** --- 1895,1903 ---- enddef def Test_for_loop_fails() + CheckDefFailure(['for '], 'E1097:') + CheckDefFailure(['for x'], 'E1097:') + CheckDefFailure(['for x in'], 'E1097:') CheckDefFailure(['for # in range(5)'], 'E690:') CheckDefFailure(['for i In range(5)'], 'E690:') CheckDefFailure(['var x = 5', 'for x in range(5)'], 'E1017:') *************** *** 3054,3071 **** delete('Xdef') enddef - def Test_put_with_linebreak() - new - var lines =<< trim END - vim9script - pu =split('abc', '\zs') - ->join() - END - CheckScriptSuccess(lines) - getline(2)->assert_equal('a b c') - bwipe! - enddef - def InvokeNormal() exe "norm! :m+1\r" enddef --- 3062,3067 ---- *** ../vim-8.2.2143/src/testdir/test_vim9_cmd.vim 2020-12-10 19:43:36.629155311 +0100 --- src/testdir/test_vim9_cmd.vim 2020-12-14 18:29:43.003207450 +0100 *************** *** 20,25 **** --- 20,28 ---- edit X`=filename`xx`=filenr`yy assert_equal('XXtestxx77yy', bufname()) + + CheckDefFailure(['edit `=xxx`'], 'E1001:') + CheckDefFailure(['edit `="foo"'], 'E1083:') enddef def Test_hardcopy_wildcards() *************** *** 626,631 **** --- 629,648 ---- assert_equal('aaa', getline(4)) bwipe! + + CheckDefFailure(['put =xxx'], 'E1001:') + enddef + + def Test_put_with_linebreak() + new + var lines =<< trim END + vim9script + pu =split('abc', '\zs') + ->join() + END + CheckScriptSuccess(lines) + getline(2)->assert_equal('a b c') + bwipe! enddef def Test_command_star_range() *** ../vim-8.2.2143/src/version.c 2020-12-13 21:26:51.565418479 +0100 --- src/version.c 2020-12-14 18:12:00.878944821 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2144, /**/ -- Mushrooms always grow in damp places and so they look like umbrellas. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///