To: vim_dev@googlegroups.com Subject: Patch 8.2.2554 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2554 Problem: Vim9: exporting a final is not tested. Solution: Add a test. Files: src/testdir/test_vim9_script.vim *** ../vim-8.2.2553/src/testdir/test_vim9_script.vim 2021-02-22 22:45:02.183661677 +0100 --- src/testdir/test_vim9_script.vim 2021-02-27 22:31:16.748136563 +0100 *************** *** 918,923 **** --- 920,926 ---- export def Exported(): string return 'Exported' enddef + export final theList = [1] END def Undo_export_script_lines() *************** *** 945,950 **** --- 948,957 ---- exp_name ..= ' Doe' g:imported_name_appended = exp_name g:imported_later = exported + + import theList from './Xexport.vim' + theList->add(2) + assert_equal([1, 2], theList) END writefile(import_script_lines, 'Ximport.vim') *************** *** 1144,1149 **** --- 1151,1168 ---- writefile(import_assign_to_const, 'Ximport.vim') assert_fails('source Ximport.vim', 'E46:', '', 1, '_Assign') + # try changing an imported final + var import_assign_to_final =<< trim END + vim9script + import theList from './Xexport.vim' + def Assign() + theList = [2] + enddef + defcompile + END + writefile(import_assign_to_final, 'Ximport.vim') + assert_fails('source Ximport.vim', 'E46:', '', 1, '_Assign') + # import a very long name, requires making a copy var import_long_name_lines =<< trim END vim9script *** ../vim-8.2.2553/src/version.c 2021-02-26 22:21:19.082675454 +0100 --- src/version.c 2021-02-27 22:29:25.252579099 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2554, /**/ -- Biting someone with your natural teeth is "simple assault," while biting someone with your false teeth is "aggravated assault." [real standing law in Louisana, United States of America] /// 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 ///