summaryrefslogtreecommitdiff
path: root/tests/lutf8lib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-15 08:14:30 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-15 08:14:30 +0100
commitdbbbb1a029fa3d6ad346426bee3310191e0dd285 (patch)
tree66da462afbc1901e6463d47ecb23f2b997a4207d /tests/lutf8lib.js
parent2269fd42e2d44096d368718c314213ff7aafc164 (diff)
downloadfengari-dbbbb1a029fa3d6ad346426bee3310191e0dd285.tar.gz
fengari-dbbbb1a029fa3d6ad346426bee3310191e0dd285.tar.bz2
fengari-dbbbb1a029fa3d6ad346426bee3310191e0dd285.zip
utf8.char
Diffstat (limited to 'tests/lutf8lib.js')
-rw-r--r--tests/lutf8lib.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/lutf8lib.js b/tests/lutf8lib.js
index edfae56..7033a57 100644
--- a/tests/lutf8lib.js
+++ b/tests/lutf8lib.js
@@ -80,4 +80,36 @@ test('utf8.codepoint', function (t) {
"Correct element(s) on the stack"
);
+});
+
+
+test('utf8.char', function (t) {
+ let luaCode = `
+ return utf8.char(40, 32, 865, 176, 32, 860, 662, 32, 865, 176, 32, 41)
+ `, L;
+
+ t.plan(3);
+
+ t.doesNotThrow(function () {
+
+ L = lauxlib.luaL_newstate();
+
+ linit.luaL_openlibs(L);
+
+ lauxlib.luaL_loadstring(L, luaCode);
+
+ }, "Lua program loaded without error");
+
+ t.doesNotThrow(function () {
+
+ lapi.lua_call(L, 0, -1);
+
+ }, "Lua program ran without error");
+
+ t.strictEqual(
+ lapi.lua_tostring(L, -1),
+ "( ͡° ͜ʖ ͡° )",
+ "Correct element(s) on the stack"
+ );
+
}); \ No newline at end of file