aboutsummaryrefslogtreecommitdiff
path: root/tests/lbaselib.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lbaselib.js')
-rw-r--r--tests/lbaselib.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/lbaselib.js b/tests/lbaselib.js
index cca3ebe..85563da 100644
--- a/tests/lbaselib.js
+++ b/tests/lbaselib.js
@@ -338,7 +338,7 @@ test('xpcall', function (t) {
return xpcall(willFail, msgh)
`, L;
- t.plan(1);
+ t.plan(3);
t.doesNotThrow(function () {
@@ -356,8 +356,13 @@ test('xpcall', function (t) {
console.log(lapi.lua_tostring(L, -1));
- // t.ok(
- // lapi.lua_tostring(L, -1).endsWith("you fucked up"),
- // "Error is on the stack"
- // )
+ t.ok(
+ lapi.lua_tostring(L, -1).startsWith("Something's wrong:"),
+ "msgh was called and modified the error"
+ )
+
+ t.ok(
+ lapi.lua_tostring(L, -1).endsWith("you fucked up"),
+ "msgh was called and modified the error"
+ )
}); \ No newline at end of file