Skip to content

Commit c63b72b

Browse files
committed
patch 8.2.1508: not all debugger commands covered by tests
Problem: Not all debugger commands covered by tests. Solution: Add tests for going up/down in the stack. (Ben Jackson, closes #6765)
1 parent 51b6eb4 commit c63b72b

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

src/testdir/test_debugger.vim

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,99 @@ func Test_Backtrace_Autocmd()
593593
\ '->0 script ' .. getcwd() .. '/Xtest2.vim',
594594
\ 'line 1: func DoAThing()'])
595595

596+
call RunDbgCmd( buf, 'up' )
597+
call RunDbgCmd( buf, 'backtrace', [
598+
\ '>backtrace',
599+
\ ' 4 User Autocommands for "TestGlobalFunction"',
600+
\ ' 3 function GlobalFunction[1]',
601+
\ ' 2 CallAFunction[1]',
602+
\ '->1 SourceAnotherFile[1]',
603+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
604+
\ 'line 1: func DoAThing()' ] )
605+
606+
call RunDbgCmd( buf, 'up' )
607+
call RunDbgCmd( buf, 'backtrace', [
608+
\ '>backtrace',
609+
\ ' 4 User Autocommands for "TestGlobalFunction"',
610+
\ ' 3 function GlobalFunction[1]',
611+
\ '->2 CallAFunction[1]',
612+
\ ' 1 SourceAnotherFile[1]',
613+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
614+
\ 'line 1: func DoAThing()' ] )
615+
616+
call RunDbgCmd( buf, 'up' )
617+
call RunDbgCmd( buf, 'backtrace', [
618+
\ '>backtrace',
619+
\ ' 4 User Autocommands for "TestGlobalFunction"',
620+
\ '->3 function GlobalFunction[1]',
621+
\ ' 2 CallAFunction[1]',
622+
\ ' 1 SourceAnotherFile[1]',
623+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
624+
\ 'line 1: func DoAThing()' ] )
625+
626+
call RunDbgCmd( buf, 'up' )
627+
call RunDbgCmd( buf, 'backtrace', [
628+
\ '>backtrace',
629+
\ '->4 User Autocommands for "TestGlobalFunction"',
630+
\ ' 3 function GlobalFunction[1]',
631+
\ ' 2 CallAFunction[1]',
632+
\ ' 1 SourceAnotherFile[1]',
633+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
634+
\ 'line 1: func DoAThing()' ] )
635+
636+
call RunDbgCmd( buf, 'up', [ 'frame at highest level: 4' ] )
637+
call RunDbgCmd( buf, 'backtrace', [
638+
\ '>backtrace',
639+
\ '->4 User Autocommands for "TestGlobalFunction"',
640+
\ ' 3 function GlobalFunction[1]',
641+
\ ' 2 CallAFunction[1]',
642+
\ ' 1 SourceAnotherFile[1]',
643+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
644+
\ 'line 1: func DoAThing()' ] )
645+
646+
call RunDbgCmd( buf, 'down' )
647+
call RunDbgCmd( buf, 'backtrace', [
648+
\ '>backtrace',
649+
\ ' 4 User Autocommands for "TestGlobalFunction"',
650+
\ '->3 function GlobalFunction[1]',
651+
\ ' 2 CallAFunction[1]',
652+
\ ' 1 SourceAnotherFile[1]',
653+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
654+
\ 'line 1: func DoAThing()' ] )
655+
656+
657+
call RunDbgCmd( buf, 'down' )
658+
call RunDbgCmd( buf, 'backtrace', [
659+
\ '>backtrace',
660+
\ ' 4 User Autocommands for "TestGlobalFunction"',
661+
\ ' 3 function GlobalFunction[1]',
662+
\ '->2 CallAFunction[1]',
663+
\ ' 1 SourceAnotherFile[1]',
664+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
665+
\ 'line 1: func DoAThing()' ] )
666+
667+
call RunDbgCmd( buf, 'down' )
668+
call RunDbgCmd( buf, 'backtrace', [
669+
\ '>backtrace',
670+
\ ' 4 User Autocommands for "TestGlobalFunction"',
671+
\ ' 3 function GlobalFunction[1]',
672+
\ ' 2 CallAFunction[1]',
673+
\ '->1 SourceAnotherFile[1]',
674+
\ ' 0 script ' .. getcwd() .. '/Xtest2.vim',
675+
\ 'line 1: func DoAThing()' ] )
676+
677+
call RunDbgCmd( buf, 'down' )
678+
call RunDbgCmd( buf, 'backtrace', [
679+
\ '>backtrace',
680+
\ ' 4 User Autocommands for "TestGlobalFunction"',
681+
\ ' 3 function GlobalFunction[1]',
682+
\ ' 2 CallAFunction[1]',
683+
\ ' 1 SourceAnotherFile[1]',
684+
\ '->0 script ' .. getcwd() .. '/Xtest2.vim',
685+
\ 'line 1: func DoAThing()' ] )
686+
687+
call RunDbgCmd( buf, 'down', [ 'frame is zero' ] )
688+
596689
" step until we have another meaninfgul trace
597690
call RunDbgCmd(buf, 'step', ['line 5: func File2Function()'])
598691
call RunDbgCmd(buf, 'step', ['line 9: call File2Function()'])

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1508,
757759
/**/
758760
1507,
759761
/**/

0 commit comments

Comments
 (0)