To: vim_dev@googlegroups.com Subject: Patch 8.2.0754 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0754 Problem: Vim9: No test for forward declaration. Solution: Add a test. Files: src/testdir/test_vim9_script.vim *** ../vim-8.2.0753/src/testdir/test_vim9_script.vim 2020-05-14 22:41:10.229637563 +0200 --- src/testdir/test_vim9_script.vim 2020-05-14 23:12:55.455278473 +0200 *************** *** 1732,1737 **** --- 1732,1738 ---- END writefile(lines, 'Xfinished') source Xfinished + " GetValue() is not called during discovery phase assert_equal(1, g:count) unlet g:count *************** *** 1752,1757 **** --- 1753,1780 ---- delete('Xfinished') enddef + def Test_forward_declaration() + let lines =<< trim END + vim9script + g:initVal = GetValue() + def GetValue(): string + return theVal + enddef + let theVal = 'something' + theVal = 'else' + g:laterVal = GetValue() + END + writefile(lines, 'Xforward') + source Xforward + assert_equal('something', g:initVal) + assert_equal('else', g:laterVal) + + unlet g:initVal + unlet g:laterVal + delete('Xforward') + enddef + + " Keep this last, it messes up highlighting. def Test_substitute_cmd() new *** ../vim-8.2.0753/src/version.c 2020-05-14 22:41:10.229637563 +0200 --- src/version.c 2020-05-14 23:13:52.831091393 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 754, /**/ -- From "know your smileys": :-* A big kiss! /// 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 ///