summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorDominique Pelle <dominique.pelle@gmail.com>2022-03-20 11:46:01 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-20 11:46:01 +0000
commitb6643d10d39c493951a6bbf3264003d35adeb811 (patch)
tree3615932ff7084cfc2f15b9d2f812166e37e8c127 /src/testdir
parentc670ebddcd9e64411fc21571c2da3053ac39e4c9 (diff)
downloadvim-git-b6643d10d39c493951a6bbf3264003d35adeb811.tar.gz
patch 8.2.4597: LuaV_debug() not covered by testsv8.2.4597
Problem: LuaV_debug() not covered by tests. Solution: Add a test. (Dominique Pellé, closes #9980)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_lua.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim
index fd265ef43..1f2df1094 100644
--- a/src/testdir/test_lua.vim
+++ b/src/testdir/test_lua.vim
@@ -1192,4 +1192,27 @@ func Test_lua_multiple_commands()
augroup! Luagroup
endfunc
+func Test_lua_debug()
+ CheckRunVimInTerminal
+
+ let buf = RunVimInTerminal('', {'rows': 10})
+ call term_sendkeys(buf, ":lua debug.debug()\n")
+ call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
+
+ call term_sendkeys(buf, "foo = 42\n")
+ call WaitForAssert({-> assert_equal('lua_debug> foo = 42', term_getline(buf, 9))})
+ call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
+
+ call term_sendkeys(buf, "print(foo)\n")
+ call WaitForAssert({-> assert_equal('lua_debug> print(foo)', term_getline(buf, 8))})
+ call WaitForAssert({-> assert_equal('42', term_getline(buf, 9))})
+ call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
+
+ call term_sendkeys(buf, "cont\n")
+ call WaitForAssert({-> assert_match(' All$', term_getline(buf, 10))})
+
+ call StopVimInTerminal(buf)
+ call delete('XtestLuaDebug.vim')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab