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