summaryrefslogtreecommitdiff
path: root/tests/debug-cli.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-11 10:06:09 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-11 10:45:32 +0200
commit4d374d77766b6f621f2194a9546521295aa528af (patch)
tree0391532304b34c87e36a85a5ea13b24d1d42fe11 /tests/debug-cli.js
parentbb51e9d6e41efe08f6f053599bf31245ab116b77 (diff)
downloadfengari-4d374d77766b6f621f2194a9546521295aa528af.tar.gz
fengari-4d374d77766b6f621f2194a9546521295aa528af.tar.bz2
fengari-4d374d77766b6f621f2194a9546521295aa528af.zip
debug.debug
Use readline-sync to read from stdin interactively
Diffstat (limited to 'tests/debug-cli.js')
-rw-r--r--tests/debug-cli.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/debug-cli.js b/tests/debug-cli.js
new file mode 100644
index 0000000..aa6847f
--- /dev/null
+++ b/tests/debug-cli.js
@@ -0,0 +1,19 @@
+"use strict";
+
+const lapi = require("../src/lapi.js");
+const lauxlib = require("../src/lauxlib.js");
+const lua = require('../src/lua.js');
+const linit = require('../src/linit.js');
+
+let luaCode = `
+ a = "debug me"
+ debug.debug()
+`, L;
+
+L = lauxlib.luaL_newstate();
+
+linit.luaL_openlibs(L);
+
+lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+
+lapi.lua_call(L, 0, -1);