To: vim_dev@googlegroups.com Subject: Patch 8.2.4564 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4564 Problem: Running test leaves file behind. (Dominique Pellé) Solution: Run the profiling in a separate Vim instance. (closes #9952) Files: src/testdir/test_vim9_script.vim *** ../vim-8.2.4563/src/testdir/test_vim9_script.vim 2022-03-10 21:53:40.829910566 +0000 --- src/testdir/test_vim9_script.vim 2022-03-14 10:48:33.710701184 +0000 *************** *** 3882,3908 **** delete('XdebugFunc') enddef - def s:ProfiledWithLambda() - var n = 3 - echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n) - enddef - - def s:ProfiledNested() - var x = 0 - def Nested(): any - return x - enddef - Nested() - enddef - - def ProfiledNestedProfiled() - var x = 0 - def Nested(): any - return x - enddef - Nested() - enddef - def Test_ambigous_command_error() var lines =<< trim END vim9script --- 3882,3887 ---- *************** *** 3935,3957 **** " Execute this near the end, profiling doesn't stop until Vim exits. " This only tests that it works, not the profiling output. ! def Test_xx_profile_with_lambda() CheckFeature profile ! profile start Xprofile.log ! profile func ProfiledWithLambda ! ProfiledWithLambda() ! ! profile func ProfiledNested ! ProfiledNested() ! ! # Also profile the nested function. Use a different function, although the ! # contents is the same, to make sure it was not already compiled. ! profile func * ! g:ProfiledNestedProfiled() ! profdel func * ! profile pause enddef " Keep this last, it messes up highlighting. --- 3914,3977 ---- " Execute this near the end, profiling doesn't stop until Vim exits. " This only tests that it works, not the profiling output. ! def Test_profile_with_lambda() CheckFeature profile ! var lines =<< trim END ! vim9script ! def ProfiledWithLambda() ! var n = 3 ! echo [[1, 2], [3, 4]]->filter((_, l) => l[0] == n) ! enddef ! ! def ProfiledNested() ! var x = 0 ! def Nested(): any ! return x ! enddef ! Nested() ! enddef ! ! def g:ProfiledNestedProfiled() ! var x = 0 ! def Nested(): any ! return x ! enddef ! Nested() ! enddef ! ! def Profile() ! profile start Xprofile.log ! profile func ProfiledWithLambda ! ProfiledWithLambda() ! ! profile func ProfiledNested ! ProfiledNested() ! ! # Also profile the nested function. Use a different function, although the ! # contents is the same, to make sure it was not already compiled. ! profile func * ! g:ProfiledNestedProfiled() ! ! profdel func * ! profile pause ! enddef ! Profile() ! writefile(['done'], 'Xdidprofile') ! END ! writefile(lines, 'Xprofile.vim') ! call system(g:GetVimCommand() ! .. ' --clean' ! .. ' -c "so Xprofile.vim"' ! .. ' -c "qall!"') ! call assert_equal(0, v:shell_error) ! ! assert_equal(['done'], readfile('Xdidprofile')) ! assert_true(filereadable('Xprofile.log')) ! delete('Xdidprofile') ! delete('Xprofile.log') ! delete('Xprofile.vim') enddef " Keep this last, it messes up highlighting. *** ../vim-8.2.4563/src/version.c 2022-03-13 20:12:21.322709463 +0000 --- src/version.c 2022-03-14 10:49:44.554340593 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4564, /**/ -- hundred-and-one symptoms of being an internet addict: 256. You are able to write down over 250 symptoms of being an internet addict, even though they only asked for 101. /// 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 ///