aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 07:42:36 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-22 07:48:59 +0100
commitc1824a99035a231172f3c10ae3ee24a3e6330260 (patch)
tree46136d16c9a7a7f34b3ef2818fff1d32e565b3c3 /tests
parent653f4a07af6506e0b8ef71e8957976b9559f67e4 (diff)
downloadfengari-c1824a99035a231172f3c10ae3ee24a3e6330260.tar.gz
fengari-c1824a99035a231172f3c10ae3ee24a3e6330260.tar.bz2
fengari-c1824a99035a231172f3c10ae3ee24a3e6330260.zip
xpcall calls msgh
Diffstat (limited to 'tests')
-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