summaryrefslogtreecommitdiff
path: root/tests/test-suite/api.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-19 00:54:11 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-19 00:54:11 +1000
commit5928a46812aa108d7388e5ad3ed0c9aa4b6d5a61 (patch)
tree71b1d216f5211623b96b17408ea5312e7aff0e86 /tests/test-suite/api.js
parent098ea04c2a85a15e621269a6f4b38d3a607f47d0 (diff)
downloadfengari-5928a46812aa108d7388e5ad3ed0c9aa4b6d5a61.tar.gz
fengari-5928a46812aa108d7388e5ad3ed0c9aa4b6d5a61.tar.bz2
fengari-5928a46812aa108d7388e5ad3ed0c9aa4b6d5a61.zip
tests/test-suite: Fix checkpanic
Diffstat (limited to 'tests/test-suite/api.js')
-rw-r--r--tests/test-suite/api.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-suite/api.js b/tests/test-suite/api.js
index a4fce37..8b59e9c 100644
--- a/tests/test-suite/api.js
+++ b/tests/test-suite/api.js
@@ -757,8 +757,7 @@ test("[test-suite] api: testing lua_to...", function (t) {
}, "Lua program ran without error");
});
-// TODO: longjmp ?
-test("[test-suite] api: testing panic function", { skip: true }, function (t) {
+test("[test-suite] api: testing panic function", function (t) {
let luaCode = `
do
-- trivial error
@@ -776,10 +775,12 @@ test("[test-suite] api: testing panic function", { skip: true }, function (t) {
"bad argument #4 (string expected, got no value)")
+ --[[ TODO: T.totalmem
-- memory error
T.totalmem(T.totalmem()+10000) -- set low memory limit (+10k)
assert(T.checkpanic("newuserdata 20000") == "not enough memory")
T.totalmem(0) -- restore high limit
+ ]]
-- stack error
if not _soft then
@@ -804,7 +805,7 @@ test("[test-suite] api: testing panic function", { skip: true }, function (t) {
ltests.luaopen_tests(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(prefix + luaCode));
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
}, "Lua program loaded without error");