patch 8.2.4611: typos in tests; one lua line not covered by test

Problem:    Typos in tests; one lua line not covered by test.
Solution:   Fix typos. Add test case. (Dominique Pellé, closes #9994)
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim
index 1f2df10..e45da6a 100644
--- a/src/testdir/test_lua.vim
+++ b/src/testdir/test_lua.vim
@@ -1208,11 +1208,21 @@
   call WaitForAssert({-> assert_equal('42',                    term_getline(buf, 9))})
   call WaitForAssert({-> assert_equal('lua_debug> ',           term_getline(buf, 10))})
 
+  call term_sendkeys(buf, "-\n")
+  call WaitForAssert({-> assert_equal("(debug command):1: unexpected symbol near '-'",
+  \                                                  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))})
 
+  " Entering an empty line also exits the debugger.
+  call term_sendkeys(buf, ":lua debug.debug()\n")
+  call WaitForAssert({-> assert_equal('lua_debug> ', term_getline(buf, 10))})
+  call term_sendkeys(buf, "\n")
+  call WaitForAssert({-> assert_match(' All$', term_getline(buf, 10))})
+
   call StopVimInTerminal(buf)
-  call delete('XtestLuaDebug.vim')
 endfunc
 
 " vim: shiftwidth=2 sts=2 expandtab