]> granicus.if.org Git - vim/commitdiff
patch 8.2.1508: not all debugger commands covered by tests v8.2.1508
authorBram Moolenaar <Bram@vim.org>
Sat, 22 Aug 2020 14:04:52 +0000 (16:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 22 Aug 2020 14:04:52 +0000 (16:04 +0200)
Problem:    Not all debugger commands covered by tests.
Solution:   Add tests for going up/down in the stack. (Ben Jackson,
            closes #6765)

src/testdir/test_debugger.vim
src/version.c

index fb2700754c67d4edc83cc7d18f708b313a740ca6..8c51675429b6a19494f050f0307502177ed7b789 100644 (file)
@@ -593,6 +593,99 @@ func Test_Backtrace_Autocmd()
         \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
         \ 'line 1: func DoAThing()'])
 
+  call RunDbgCmd( buf, 'up' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '->1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'up' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '->2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'up' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '->3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'up' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '->4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'up', [ 'frame at highest level: 4' ] )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '->4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'down' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '->3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+
+  call RunDbgCmd( buf, 'down' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '->2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'down' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '->1 SourceAnotherFile[1]',
+        \ '  0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'down' )
+  call RunDbgCmd( buf, 'backtrace', [
+        \ '>backtrace',
+        \ '  4 User Autocommands for "TestGlobalFunction"',
+        \ '  3 function GlobalFunction[1]',
+        \ '  2 CallAFunction[1]',
+        \ '  1 SourceAnotherFile[1]',
+        \ '->0 script ' .. getcwd() .. '/Xtest2.vim',
+        \ 'line 1: func DoAThing()' ] )
+
+  call RunDbgCmd( buf, 'down', [ 'frame is zero' ] )
+
   " step until we have another meaninfgul trace
   call RunDbgCmd(buf, 'step', ['line 5: func File2Function()'])
   call RunDbgCmd(buf, 'step', ['line 9: call File2Function()'])
index bb1624f6e89ee749e920980f1259eefedae8955d..26075ce29d583762e04c234e96cbfd657f072cd0 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1508,
 /**/
     1507,
 /**/