comparison src/testdir/test_debugger.vim @ 25059:671ded1facd5

patch 8.2.3066: Vim9: debugging lambda does not work Commit: https://github.com/vim/vim/commit/17d868b8b268c9b9670421039d1a772341937add Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 27 16:29:53 2021 +0200 patch 8.2.3066: Vim9: debugging lambda does not work Problem: Vim9: debugging lambda does not work. Solution: Use the compile type of the function when compiling a lambda. (closes #8412)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Jun 2021 16:30:04 +0200
parents 70f55a30f03c
children 765a642e0e20
comparison
equal deleted inserted replaced
25058:2bf78a07dd43 25059:671ded1facd5
930 call StopVimInTerminal(buf) 930 call StopVimInTerminal(buf)
931 call delete('Xtest1.vim') 931 call delete('Xtest1.vim')
932 call delete('Xtest2.vim') 932 call delete('Xtest2.vim')
933 endfunc 933 endfunc
934 934
935 func Test_debug_DefFunction() 935 func Test_debug_def_and_legacy_function()
936 CheckCWD 936 CheckCWD
937 let file =<< trim END 937 let file =<< trim END
938 vim9script 938 vim9script
939 def g:SomeFunc() 939 def g:SomeFunc()
940 echo "here" 940 echo "here"
1066 call RunDbgCmd(buf, 'cont') 1066 call RunDbgCmd(buf, 'cont')
1067 call StopVimInTerminal(buf) 1067 call StopVimInTerminal(buf)
1068 call delete('Xtest.vim') 1068 call delete('Xtest.vim')
1069 endfunc 1069 endfunc
1070 1070
1071 func Test_debug_def_function_with_lambda()
1072 CheckCWD
1073 let lines =<< trim END
1074 vim9script
1075 def g:Func()
1076 var s = 'a'
1077 ['b']->map((_, v) => s)
1078 echo "done"
1079 enddef
1080 breakadd func 2 g:Func
1081 END
1082 call writefile(lines, 'XtestLambda.vim')
1083
1084 let buf = RunVimInTerminal('-S XtestLambda.vim', {})
1085
1086 call RunDbgCmd(buf,
1087 \ ':call g:Func()',
1088 \ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
1089 call RunDbgCmd(buf,
1090 \ 'next',
1091 \ ['function Func', 'line 3: echo "done"'])
1092
1093 call RunDbgCmd(buf, 'cont')
1094 call StopVimInTerminal(buf)
1095 call delete('XtestLambda.vim')
1096 endfunc
1097
1071 func Test_debug_backtrace_level() 1098 func Test_debug_backtrace_level()
1072 CheckCWD 1099 CheckCWD
1073 let lines =<< trim END 1100 let lines =<< trim END
1074 let s:file1_var = 'file1' 1101 let s:file1_var = 'file1'
1075 let g:global_var = 'global' 1102 let g:global_var = 'global'