diff src/testdir/test_lambda.vim @ 28515:c6aadb2c4cd7 v8.2.4782

patch 8.2.4782: accessing freed memory Commit: https://github.com/vim/vim/commit/a929c922b1cb7c84ad1b5d1d0fc9a4f7c68ab8e0 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 18 15:21:17 2022 +0100 patch 8.2.4782: accessing freed memory Problem: Accessing freed memory. Solution: Clear evalarg after checking for trailing characters. (issue #10218)
author Bram Moolenaar <Bram@vim.org>
date Mon, 18 Apr 2022 16:30:03 +0200
parents a35d54d01ade
children 2748a023cc37
line wrap: on
line diff
--- a/src/testdir/test_lambda.vim
+++ b/src/testdir/test_lambda.vim
@@ -1,6 +1,7 @@
 " Test for lambda and closure
 
 source check.vim
+import './vim9.vim' as v9
 
 func Test_lambda_feature()
   call assert_equal(1, has('lambda'))
@@ -54,6 +55,21 @@ func Test_lambda_with_timer()
   call assert_true(s:n > m)
 endfunc
 
+func Test_lambda_vim9cmd_linebreak()
+  CheckFeature timers
+
+  let lines =<< trim END
+      vim9cmd call timer_start(10, (x) => {
+          # comment
+          g:result = 'done'
+         })
+  END
+  call v9.CheckScriptSuccess(lines)
+  sleep 50m
+  call assert_equal('done', g:result)
+  unlet g:result
+endfunc
+
 func Test_lambda_with_partial()
   let l:Cb = function({... -> ['zero', a:1, a:2, a:3]}, ['one', 'two'])
   call assert_equal(['zero', 'one', 'two', 'three'], l:Cb('three'))