Mercurial > vim
comparison src/testdir/test_debugger.vim @ 30379:25e3121ed316 v9.0.0525
patch 9.0.0525: manually deleting temp test files
Commit: https://github.com/vim/vim/commit/5917341f65d4fc669b9d15343ccdb00c160201da
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Sep 20 22:01:33 2022 +0100
patch 9.0.0525: manually deleting temp test files
Problem: Manually deleting temp test files.
Solution: Add the 'D' flag to writefile().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 20 Sep 2022 23:15:04 +0200 |
parents | a9b2609186bf |
children | b005d7886185 |
comparison
equal
deleted
inserted
replaced
30378:403d8362f8d1 | 30379:25e3121ed316 |
---|---|
79 echo cmd | 79 echo cmd |
80 endfor | 80 endfor |
81 endfor | 81 endfor |
82 enddef | 82 enddef |
83 END | 83 END |
84 call writefile(lines, 'Xtest.vim') | 84 call writefile(lines, 'XtestDebug.vim', 'D') |
85 | 85 |
86 " Start Vim in a terminal | 86 " Start Vim in a terminal |
87 let buf = RunVimInTerminal('-S Xtest.vim', {}) | 87 let buf = RunVimInTerminal('-S XtestDebug.vim', {}) |
88 | 88 |
89 " Start the Vim debugger | 89 " Start the Vim debugger |
90 call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()']) | 90 call RunDbgCmd(buf, ':debug echo Foo()', ['cmd: echo Foo()']) |
91 | 91 |
92 " Create a few stack frames by stepping through functions | 92 " Create a few stack frames by stepping through functions |
341 let var1 = 10 | 341 let var1 = 10 |
342 let var2 = 20 | 342 let var2 = 20 |
343 let var3 = 30 | 343 let var3 = 30 |
344 let var4 = 40 | 344 let var4 = 40 |
345 END | 345 END |
346 call writefile(lines, 'Xtest.vim') | 346 call writefile(lines, 'XdebugBreakadd.vim', 'D') |
347 | 347 |
348 " Start Vim in a terminal | 348 " Start Vim in a terminal |
349 let buf = RunVimInTerminal('Xtest.vim', {}) | 349 let buf = RunVimInTerminal('XdebugBreakadd.vim', {}) |
350 call RunDbgCmd(buf, ':breakadd file 2 Xtest.vim') | 350 call RunDbgCmd(buf, ':breakadd file 2 XdebugBreakadd.vim') |
351 call RunDbgCmd(buf, ':4 | breakadd here') | 351 call RunDbgCmd(buf, ':4 | breakadd here') |
352 call RunDbgCmd(buf, ':source Xtest.vim', ['line 2: let var2 = 20']) | 352 call RunDbgCmd(buf, ':source XdebugBreakadd.vim', ['line 2: let var2 = 20']) |
353 call RunDbgCmd(buf, 'cont', ['line 4: let var4 = 40']) | 353 call RunDbgCmd(buf, 'cont', ['line 4: let var4 = 40']) |
354 call RunDbgCmd(buf, 'cont') | 354 call RunDbgCmd(buf, 'cont') |
355 | 355 |
356 call StopVimInTerminal(buf) | 356 call StopVimInTerminal(buf) |
357 | 357 |
358 call delete('Xtest.vim') | |
359 %bw! | 358 %bw! |
360 | 359 |
361 call assert_fails('breakadd here', 'E32:') | 360 call assert_fails('breakadd here', 'E32:') |
362 call assert_fails('breakadd file Xtest.vim /\)/', 'E55:') | 361 call assert_fails('breakadd file Xtest.vim /\)/', 'E55:') |
363 endfunc | 362 endfunc |
367 CheckCWD | 366 CheckCWD |
368 | 367 |
369 let lines =<< trim END | 368 let lines =<< trim END |
370 let g:Xtest_var += 1 | 369 let g:Xtest_var += 1 |
371 END | 370 END |
372 call writefile(lines, 'Xtest.vim') | 371 call writefile(lines, 'XdebugBreakExpr.vim', 'D') |
373 | 372 |
374 " Start Vim in a terminal | 373 " Start Vim in a terminal |
375 let buf = RunVimInTerminal('Xtest.vim', {}) | 374 let buf = RunVimInTerminal('XdebugBreakExpr.vim', {}) |
376 call RunDbgCmd(buf, ':let g:Xtest_var = 10') | 375 call RunDbgCmd(buf, ':let g:Xtest_var = 10') |
377 call RunDbgCmd(buf, ':breakadd expr g:Xtest_var') | 376 call RunDbgCmd(buf, ':breakadd expr g:Xtest_var') |
378 call RunDbgCmd(buf, ':source %') | 377 call RunDbgCmd(buf, ':source %') |
379 let expected =<< eval trim END | 378 let expected =<< trim eval END |
380 Oldval = "10" | 379 Oldval = "10" |
381 Newval = "11" | 380 Newval = "11" |
382 {fnamemodify('Xtest.vim', ':p')} | 381 {fnamemodify('XdebugBreakExpr.vim', ':p')} |
383 line 1: let g:Xtest_var += 1 | 382 line 1: let g:Xtest_var += 1 |
384 END | 383 END |
385 call RunDbgCmd(buf, ':source %', expected) | 384 call RunDbgCmd(buf, ':source %', expected) |
386 call RunDbgCmd(buf, 'cont') | 385 call RunDbgCmd(buf, 'cont') |
387 let expected =<< eval trim END | 386 let expected =<< trim eval END |
388 Oldval = "11" | 387 Oldval = "11" |
389 Newval = "12" | 388 Newval = "12" |
390 {fnamemodify('Xtest.vim', ':p')} | 389 {fnamemodify('XdebugBreakExpr.vim', ':p')} |
391 line 1: let g:Xtest_var += 1 | 390 line 1: let g:Xtest_var += 1 |
392 END | 391 END |
393 call RunDbgCmd(buf, ':source %', expected) | 392 call RunDbgCmd(buf, ':source %', expected) |
394 | 393 |
395 call StopVimInTerminal(buf) | 394 call StopVimInTerminal(buf) |
396 call delete('Xtest.vim') | |
397 endfunc | 395 endfunc |
398 | 396 |
399 def Test_Debugger_breakadd_vim9_expr() | 397 def Test_Debugger_breakadd_vim9_expr() |
400 var lines =<< trim END | 398 var lines =<< trim END |
401 vim9script | 399 vim9script |
404 breakadd expr DoesNotExist() | 402 breakadd expr DoesNotExist() |
405 func g:LaterFunc() | 403 func g:LaterFunc() |
406 endfunc | 404 endfunc |
407 breakdel * | 405 breakdel * |
408 END | 406 END |
409 writefile(lines, 'Xtest.vim') | 407 writefile(lines, 'XdebugBreak9expr.vim', 'D') |
410 | 408 |
411 # Start Vim in a terminal | 409 # Start Vim in a terminal |
412 var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0}) | 410 var buf = g:RunVimInTerminal('-S XdebugBreak9expr.vim', {wait_for_ruler: 0}) |
413 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) | 411 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) |
414 | 412 |
415 # Despite the failure the functions are defined | 413 # Despite the failure the functions are defined |
416 g:RunDbgCmd(buf, ':function g:EarlyFunc', | 414 g:RunDbgCmd(buf, ':function g:EarlyFunc', |
417 ['function EarlyFunc()', 'endfunction'], {match: 'pattern'}) | 415 ['function EarlyFunc()', 'endfunction'], {match: 'pattern'}) |
418 g:RunDbgCmd(buf, ':function g:LaterFunc', | 416 g:RunDbgCmd(buf, ':function g:LaterFunc', |
419 ['function LaterFunc()', 'endfunction'], {match: 'pattern'}) | 417 ['function LaterFunc()', 'endfunction'], {match: 'pattern'}) |
420 | 418 |
421 call g:StopVimInTerminal(buf) | 419 call g:StopVimInTerminal(buf) |
422 call delete('Xtest.vim') | |
423 enddef | 420 enddef |
424 | 421 |
425 def Test_Debugger_break_at_return() | 422 def Test_Debugger_break_at_return() |
426 var lines =<< trim END | 423 var lines =<< trim END |
427 vim9script | 424 vim9script |
430 + 2 | 427 + 2 |
431 + 3 | 428 + 3 |
432 enddef | 429 enddef |
433 breakadd func GetNum | 430 breakadd func GetNum |
434 END | 431 END |
435 writefile(lines, 'Xtest.vim') | 432 writefile(lines, 'XdebugBreakRet.vim', 'D') |
436 | 433 |
437 # Start Vim in a terminal | 434 # Start Vim in a terminal |
438 var buf = g:RunVimInTerminal('-S Xtest.vim', {wait_for_ruler: 0}) | 435 var buf = g:RunVimInTerminal('-S XdebugBreakRet.vim', {wait_for_ruler: 0}) |
439 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) | 436 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) |
440 | 437 |
441 g:RunDbgCmd(buf, ':call GetNum()', | 438 g:RunDbgCmd(buf, ':call GetNum()', |
442 ['line 1: return 1 + 2 + 3'], {match: 'pattern'}) | 439 ['line 1: return 1 + 2 + 3'], {match: 'pattern'}) |
443 | 440 |
444 call g:StopVimInTerminal(buf) | 441 call g:StopVimInTerminal(buf) |
445 call delete('Xtest.vim') | |
446 enddef | 442 enddef |
447 | 443 |
448 func Test_Backtrace_Through_Source() | 444 func Test_Backtrace_Through_Source() |
449 CheckCWD | 445 CheckCWD |
450 let file1 =<< trim END | 446 let file1 =<< trim END |
459 | 455 |
460 func GlobalFunction() | 456 func GlobalFunction() |
461 call CallAFunction() | 457 call CallAFunction() |
462 endfunc | 458 endfunc |
463 END | 459 END |
464 call writefile(file1, 'Xtest1.vim') | 460 call writefile(file1, 'Xtest1.vim', 'D') |
465 | 461 |
466 let file2 =<< trim END | 462 let file2 =<< trim END |
467 func DoAThing() | 463 func DoAThing() |
468 echo "DoAThing" | 464 echo "DoAThing" |
469 endfunc | 465 endfunc |
472 call DoAThing() | 468 call DoAThing() |
473 endfunc | 469 endfunc |
474 | 470 |
475 call File2Function() | 471 call File2Function() |
476 END | 472 END |
477 call writefile(file2, 'Xtest2.vim') | 473 call writefile(file2, 'Xtest2.vim', 'D') |
478 | 474 |
479 let buf = RunVimInTerminal('-S Xtest1.vim', {}) | 475 let buf = RunVimInTerminal('-S Xtest1.vim', {}) |
480 | 476 |
481 call RunDbgCmd(buf, | 477 call RunDbgCmd(buf, |
482 \ ':debug call GlobalFunction()', | 478 \ ':debug call GlobalFunction()', |
614 \ ' 1 CallAFunction[2]', | 610 \ ' 1 CallAFunction[2]', |
615 \ '->0 File2Function', | 611 \ '->0 File2Function', |
616 \ 'line 1: call DoAThing()']) | 612 \ 'line 1: call DoAThing()']) |
617 | 613 |
618 call StopVimInTerminal(buf) | 614 call StopVimInTerminal(buf) |
619 call delete('Xtest1.vim') | |
620 call delete('Xtest2.vim') | |
621 endfunc | 615 endfunc |
622 | 616 |
623 func Test_Backtrace_Autocmd() | 617 func Test_Backtrace_Autocmd() |
624 CheckCWD | 618 CheckCWD |
625 let file1 =<< trim END | 619 let file1 =<< trim END |
636 call CallAFunction() | 630 call CallAFunction() |
637 endfunc | 631 endfunc |
638 | 632 |
639 au User TestGlobalFunction :call GlobalFunction() | echo "Done" | 633 au User TestGlobalFunction :call GlobalFunction() | echo "Done" |
640 END | 634 END |
641 call writefile(file1, 'Xtest1.vim') | 635 call writefile(file1, 'Xtest1.vim', 'D') |
642 | 636 |
643 let file2 =<< trim END | 637 let file2 =<< trim END |
644 func DoAThing() | 638 func DoAThing() |
645 echo "DoAThing" | 639 echo "DoAThing" |
646 endfunc | 640 endfunc |
649 call DoAThing() | 643 call DoAThing() |
650 endfunc | 644 endfunc |
651 | 645 |
652 call File2Function() | 646 call File2Function() |
653 END | 647 END |
654 call writefile(file2, 'Xtest2.vim') | 648 call writefile(file2, 'Xtest2.vim', 'D') |
655 | 649 |
656 let buf = RunVimInTerminal('-S Xtest1.vim', {}) | 650 let buf = RunVimInTerminal('-S Xtest1.vim', {}) |
657 | 651 |
658 call RunDbgCmd(buf, | 652 call RunDbgCmd(buf, |
659 \ ':debug doautocmd User TestGlobalFunction', | 653 \ ':debug doautocmd User TestGlobalFunction', |
869 \ '>backtrace', | 863 \ '>backtrace', |
870 \ '->0 User Autocommands for "TestGlobalFunction"', | 864 \ '->0 User Autocommands for "TestGlobalFunction"', |
871 \ 'cmd: echo "Done"']) | 865 \ 'cmd: echo "Done"']) |
872 | 866 |
873 call StopVimInTerminal(buf) | 867 call StopVimInTerminal(buf) |
874 call delete('Xtest1.vim') | |
875 call delete('Xtest2.vim') | |
876 endfunc | 868 endfunc |
877 | 869 |
878 func Test_Backtrace_CmdLine() | 870 func Test_Backtrace_CmdLine() |
879 CheckCWD | 871 CheckCWD |
880 let file1 =<< trim END | 872 let file1 =<< trim END |
891 call CallAFunction() | 883 call CallAFunction() |
892 endfunc | 884 endfunc |
893 | 885 |
894 au User TestGlobalFunction :call GlobalFunction() | echo "Done" | 886 au User TestGlobalFunction :call GlobalFunction() | echo "Done" |
895 END | 887 END |
896 call writefile(file1, 'Xtest1.vim') | 888 call writefile(file1, 'Xtest1.vim', 'D') |
897 | 889 |
898 let file2 =<< trim END | 890 let file2 =<< trim END |
899 func DoAThing() | 891 func DoAThing() |
900 echo "DoAThing" | 892 echo "DoAThing" |
901 endfunc | 893 endfunc |
904 call DoAThing() | 896 call DoAThing() |
905 endfunc | 897 endfunc |
906 | 898 |
907 call File2Function() | 899 call File2Function() |
908 END | 900 END |
909 call writefile(file2, 'Xtest2.vim') | 901 call writefile(file2, 'Xtest2.vim', 'D') |
910 | 902 |
911 let buf = RunVimInTerminal( | 903 let buf = RunVimInTerminal( |
912 \ '-S Xtest1.vim -c "debug call GlobalFunction()"', | 904 \ '-S Xtest1.vim -c "debug call GlobalFunction()"', |
913 \ {'wait_for_ruler': 0}) | 905 \ {'wait_for_ruler': 0}) |
914 | 906 |
930 \ ' 1 command line', | 922 \ ' 1 command line', |
931 \ '->0 function GlobalFunction', | 923 \ '->0 function GlobalFunction', |
932 \ 'line 1: call CallAFunction()']) | 924 \ 'line 1: call CallAFunction()']) |
933 | 925 |
934 call StopVimInTerminal(buf) | 926 call StopVimInTerminal(buf) |
935 call delete('Xtest1.vim') | |
936 call delete('Xtest2.vim') | |
937 endfunc | 927 endfunc |
938 | 928 |
939 func Test_Backtrace_DefFunction() | 929 func Test_Backtrace_DefFunction() |
940 CheckCWD | 930 CheckCWD |
941 let file1 =<< trim END | 931 let file1 =<< trim END |
956 CallAFunction() | 946 CallAFunction() |
957 enddef | 947 enddef |
958 | 948 |
959 defcompile | 949 defcompile |
960 END | 950 END |
961 call writefile(file1, 'Xtest1.vim') | 951 call writefile(file1, 'Xtest1.vim', 'D') |
962 | 952 |
963 let file2 =<< trim END | 953 let file2 =<< trim END |
964 vim9script | 954 vim9script |
965 | 955 |
966 def DoAThing(): number | 956 def DoAThing(): number |
974 enddef | 964 enddef |
975 | 965 |
976 defcompile | 966 defcompile |
977 File2Function() | 967 File2Function() |
978 END | 968 END |
979 call writefile(file2, 'Xtest2.vim') | 969 call writefile(file2, 'Xtest2.vim', 'D') |
980 | 970 |
981 let buf = RunVimInTerminal('-S Xtest1.vim', {}) | 971 let buf = RunVimInTerminal('-S Xtest1.vim', {}) |
982 | 972 |
983 call RunDbgCmd(buf, | 973 call RunDbgCmd(buf, |
984 \ ':debug call GlobalFunction()', | 974 \ ':debug call GlobalFunction()', |
1025 \ '\V->0 script ' .. getcwd() .. '/Xtest2.vim', | 1015 \ '\V->0 script ' .. getcwd() .. '/Xtest2.vim', |
1026 \ '\Vline 15: End of sourced file'], | 1016 \ '\Vline 15: End of sourced file'], |
1027 \ #{match: 'pattern'}) | 1017 \ #{match: 'pattern'}) |
1028 | 1018 |
1029 call StopVimInTerminal(buf) | 1019 call StopVimInTerminal(buf) |
1030 call delete('Xtest1.vim') | |
1031 call delete('Xtest2.vim') | |
1032 endfunc | 1020 endfunc |
1033 | 1021 |
1034 func Test_DefFunction_expr() | 1022 func Test_DefFunction_expr() |
1035 CheckCWD | 1023 CheckCWD |
1036 let file3 =<< trim END | 1024 let file3 =<< trim END |
1040 g:someVar = "bar" | 1028 g:someVar = "bar" |
1041 echo "changed" | 1029 echo "changed" |
1042 enddef | 1030 enddef |
1043 defcompile | 1031 defcompile |
1044 END | 1032 END |
1045 call writefile(file3, 'Xtest3.vim') | 1033 call writefile(file3, 'Xtest3.vim', 'D') |
1046 let buf = RunVimInTerminal('-S Xtest3.vim', {}) | 1034 let buf = RunVimInTerminal('-S Xtest3.vim', {}) |
1047 | 1035 |
1048 call RunDbgCmd(buf, ':breakadd expr g:someVar') | 1036 call RunDbgCmd(buf, ':breakadd expr g:someVar') |
1049 call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"']) | 1037 call RunDbgCmd(buf, ':call g:ChangeVar()', ['Oldval = "''foo''"', 'Newval = "''bar''"', 'function ChangeVar', 'line 2: echo "changed"']) |
1050 | 1038 |
1051 call StopVimInTerminal(buf) | 1039 call StopVimInTerminal(buf) |
1052 call delete('Xtest3.vim') | |
1053 endfunc | 1040 endfunc |
1054 | 1041 |
1055 func Test_debug_def_and_legacy_function() | 1042 func Test_debug_def_and_legacy_function() |
1056 CheckCWD | 1043 CheckCWD |
1057 let file =<< trim END | 1044 let file =<< trim END |
1076 echo "legtwo" | 1063 echo "legtwo" |
1077 endfunc | 1064 endfunc |
1078 | 1065 |
1079 breakadd func 2 g:SomeFunc | 1066 breakadd func 2 g:SomeFunc |
1080 END | 1067 END |
1081 call writefile(file, 'XtestDebug.vim') | 1068 call writefile(file, 'XtestDebug.vim', 'D') |
1082 | 1069 |
1083 let buf = RunVimInTerminal('-S XtestDebug.vim', {}) | 1070 let buf = RunVimInTerminal('-S XtestDebug.vim', {}) |
1084 | 1071 |
1085 call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"']) | 1072 call RunDbgCmd(buf,':call SomeFunc()', ['line 2: echo "and"']) |
1086 call RunDbgCmd(buf,'next', ['line 3: echo "there"']) | 1073 call RunDbgCmd(buf,'next', ['line 3: echo "there"']) |
1093 call RunDbgCmd(buf,'cont', ['line 1: echo "legone"']) | 1080 call RunDbgCmd(buf,'cont', ['line 1: echo "legone"']) |
1094 | 1081 |
1095 call RunDbgCmd(buf, 'cont') | 1082 call RunDbgCmd(buf, 'cont') |
1096 | 1083 |
1097 call StopVimInTerminal(buf) | 1084 call StopVimInTerminal(buf) |
1098 call delete('XtestDebug.vim') | |
1099 endfunc | 1085 endfunc |
1100 | 1086 |
1101 func Test_debug_def_function() | 1087 func Test_debug_def_function() |
1102 CheckCWD | 1088 CheckCWD |
1103 let file =<< trim END | 1089 let file =<< trim END |
1149 def g:FuncWithSplitLine() | 1135 def g:FuncWithSplitLine() |
1150 eval 1 + 2 | 1136 eval 1 + 2 |
1151 | eval 2 + 3 | 1137 | eval 2 + 3 |
1152 enddef | 1138 enddef |
1153 END | 1139 END |
1154 call writefile(file, 'Xtest.vim') | 1140 call writefile(file, 'Xtest.vim', 'D') |
1155 | 1141 |
1156 let buf = RunVimInTerminal('-S Xtest.vim', {}) | 1142 let buf = RunVimInTerminal('-S Xtest.vim', {}) |
1157 | 1143 |
1158 call RunDbgCmd(buf, | 1144 call RunDbgCmd(buf, |
1159 \ ':debug call Func()', | 1145 \ ':debug call Func()', |
1216 call RunDbgCmd(buf, ':breakadd func FuncWithSplitLine') | 1202 call RunDbgCmd(buf, ':breakadd func FuncWithSplitLine') |
1217 call RunDbgCmd(buf, ':call FuncWithSplitLine()', ['function FuncWithSplitLine', 'line 1: eval 1 + 2 | eval 2 + 3']) | 1203 call RunDbgCmd(buf, ':call FuncWithSplitLine()', ['function FuncWithSplitLine', 'line 1: eval 1 + 2 | eval 2 + 3']) |
1218 | 1204 |
1219 call RunDbgCmd(buf, 'cont') | 1205 call RunDbgCmd(buf, 'cont') |
1220 call StopVimInTerminal(buf) | 1206 call StopVimInTerminal(buf) |
1221 call delete('Xtest.vim') | |
1222 endfunc | 1207 endfunc |
1223 | 1208 |
1224 func Test_debug_def_function_with_lambda() | 1209 func Test_debug_def_function_with_lambda() |
1225 CheckCWD | 1210 CheckCWD |
1226 let lines =<< trim END | 1211 let lines =<< trim END |
1230 ['b']->map((_, v) => s) | 1215 ['b']->map((_, v) => s) |
1231 echo "done" | 1216 echo "done" |
1232 enddef | 1217 enddef |
1233 breakadd func 2 g:Func | 1218 breakadd func 2 g:Func |
1234 END | 1219 END |
1235 call writefile(lines, 'XtestLambda.vim') | 1220 call writefile(lines, 'XtestLambda.vim', 'D') |
1236 | 1221 |
1237 let buf = RunVimInTerminal('-S XtestLambda.vim', {}) | 1222 let buf = RunVimInTerminal('-S XtestLambda.vim', {}) |
1238 | 1223 |
1239 call RunDbgCmd(buf, | 1224 call RunDbgCmd(buf, |
1240 \ ':call g:Func()', | 1225 \ ':call g:Func()', |
1243 \ 'next', | 1228 \ 'next', |
1244 \ ['function Func', 'line 3: echo "done"']) | 1229 \ ['function Func', 'line 3: echo "done"']) |
1245 | 1230 |
1246 call RunDbgCmd(buf, 'cont') | 1231 call RunDbgCmd(buf, 'cont') |
1247 call StopVimInTerminal(buf) | 1232 call StopVimInTerminal(buf) |
1248 call delete('XtestLambda.vim') | |
1249 endfunc | 1233 endfunc |
1250 | 1234 |
1251 func Test_debug_backtrace_level() | 1235 func Test_debug_backtrace_level() |
1252 CheckCWD | 1236 CheckCWD |
1253 let lines =<< trim END | 1237 let lines =<< trim END |
1261 source Xtest2.vim | 1245 source Xtest2.vim |
1262 endfunc | 1246 endfunc |
1263 | 1247 |
1264 call s:File1Func( 'arg1' ) | 1248 call s:File1Func( 'arg1' ) |
1265 END | 1249 END |
1266 call writefile(lines, 'Xtest1.vim') | 1250 call writefile(lines, 'Xtest1.vim', 'D') |
1267 | 1251 |
1268 let lines =<< trim END | 1252 let lines =<< trim END |
1269 let s:file2_var = 'file2' | 1253 let s:file2_var = 'file2' |
1270 | 1254 |
1271 func s:File2Func( arg ) | 1255 func s:File2Func( arg ) |
1274 let g:global_var .= local_var | 1258 let g:global_var .= local_var |
1275 endfunc | 1259 endfunc |
1276 | 1260 |
1277 call s:File2Func( 'arg2' ) | 1261 call s:File2Func( 'arg2' ) |
1278 END | 1262 END |
1279 call writefile(lines, 'Xtest2.vim') | 1263 call writefile(lines, 'Xtest2.vim', 'D') |
1280 | 1264 |
1281 let file1 = getcwd() .. '/Xtest1.vim' | 1265 let file1 = getcwd() .. '/Xtest1.vim' |
1282 let file2 = getcwd() .. '/Xtest2.vim' | 1266 let file2 = getcwd() .. '/Xtest2.vim' |
1283 | 1267 |
1284 " set a breakpoint and source file1.vim | 1268 " set a breakpoint and source file1.vim |
1435 \ [ 'E121: Undefined variable: s:file1_var' ] ) | 1419 \ [ 'E121: Undefined variable: s:file1_var' ] ) |
1436 call RunDbgCmd(buf, 'echo s:file2_var', [ 'file2' ] ) | 1420 call RunDbgCmd(buf, 'echo s:file2_var', [ 'file2' ] ) |
1437 | 1421 |
1438 call RunDbgCmd(buf, 'cont') | 1422 call RunDbgCmd(buf, 'cont') |
1439 call StopVimInTerminal(buf) | 1423 call StopVimInTerminal(buf) |
1440 call delete('Xtest1.vim') | |
1441 call delete('Xtest2.vim') | |
1442 endfunc | 1424 endfunc |
1443 | 1425 |
1444 " Test for setting a breakpoint on a :endif where the :if condition is false | 1426 " Test for setting a breakpoint on a :endif where the :if condition is false |
1445 " and then quit the script. This should generate an interrupt. | 1427 " and then quit the script. This should generate an interrupt. |
1446 func Test_breakpt_endif_intr() | 1428 func Test_breakpt_endif_intr() |