diff src/testdir/test_debugger.vim @ 28570:35e24d9de858 v8.2.4809

patch 8.2.4809: various things no6 properly tested Commit: https://github.com/vim/vim/commit/885de449c0c0ef4a8541ed1f5377351844384516 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Apr 23 10:51:14 2022 +0100 patch 8.2.4809: various things no6 properly tested Problem: Various things no6 properly tested. Solution: Add various test cases. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/10259)
author Bram Moolenaar <Bram@vim.org>
date Sat, 23 Apr 2022 12:00:06 +0200
parents 73f4d1e479f2
children 723c7d940cba
line wrap: on
line diff
--- a/src/testdir/test_debugger.vim
+++ b/src/testdir/test_debugger.vim
@@ -362,7 +362,39 @@ func Test_Debugger_breakadd()
   call assert_fails('breakadd file Xtest.vim /\)/', 'E55:')
 endfunc
 
-def Test_Debugger_breakadd_expr()
+" Test for expression breakpoint set using ":breakadd expr <expr>"
+func Test_Debugger_breakadd_expr()
+  let lines =<< trim END
+    let g:Xtest_var += 1
+  END
+  call writefile(lines, 'Xtest.vim')
+
+  " Start Vim in a terminal
+  let buf = RunVimInTerminal('Xtest.vim', {})
+  call RunDbgCmd(buf, ':let g:Xtest_var = 10')
+  call RunDbgCmd(buf, ':breakadd expr g:Xtest_var')
+  call RunDbgCmd(buf, ':source %')
+  let expected =<< eval trim END
+    Oldval = "10"
+    Newval = "11"
+    `=fnamemodify('Xtest.vim', ':p')`
+    line 1: let g:Xtest_var += 1
+  END
+  call RunDbgCmd(buf, ':source %', expected)
+  call RunDbgCmd(buf, 'cont')
+  let expected =<< eval trim END
+    Oldval = "11"
+    Newval = "12"
+    `=fnamemodify('Xtest.vim', ':p')`
+    line 1: let g:Xtest_var += 1
+  END
+  call RunDbgCmd(buf, ':source %', expected)
+
+  call StopVimInTerminal(buf)
+  call delete('Xtest.vim')
+endfunc
+
+def Test_Debugger_breakadd_vim9_expr()
   var lines =<< trim END
       vim9script
       func g:EarlyFunc()