summaryrefslogtreecommitdiff
path: root/tests/lexparse.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 09:53:38 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 09:53:38 +0100
commit61168b0ab774e7be6deb1573fbcc9b1a53a37f4e (patch)
tree58182d9543a51f524748d488c0aa69ded166193f /tests/lexparse.js
parent7ad7432bcf5e0666b719c768c3c0041fbb574feb (diff)
downloadfengari-61168b0ab774e7be6deb1573fbcc9b1a53a37f4e.tar.gz
fengari-61168b0ab774e7be6deb1573fbcc9b1a53a37f4e.tar.bz2
fengari-61168b0ab774e7be6deb1573fbcc9b1a53a37f4e.zip
[Parsing tests] TEST
Diffstat (limited to 'tests/lexparse.js')
-rw-r--r--tests/lexparse.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/lexparse.js b/tests/lexparse.js
index 2470e5d..7ef5fe3 100644
--- a/tests/lexparse.js
+++ b/tests/lexparse.js
@@ -433,4 +433,38 @@ test('TESTSET (or)', function (t) {
"hello",
"Program output is correct"
);
+});
+
+
+test('TEST (false)', function (t) {
+ let luaCode = `
+ local a = false
+ local b = "hello"
+
+ if a then
+ return b
+ end
+
+ return "goodbye"
+ `, L;
+
+ t.plan(2);
+
+ t.doesNotThrow(function () {
+
+ L = lauxlib.luaL_newstate();
+
+ linit.luaL_openlibs(L);
+
+ lapi.lua_load(L, null, luaCode, "test", "text");
+
+ lapi.lua_call(L, 0, -1);
+
+ }, "JS Lua program ran without error");
+
+ t.strictEqual(
+ lapi.lua_tostring(L, -1),
+ "goodbye",
+ "Program output is correct"
+ );
}); \ No newline at end of file