aboutsummaryrefslogtreecommitdiff
path: root/tests/ldebug.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-29 14:39:57 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-03-30 09:57:53 +0200
commit456ab7b69f88859683c60cc2261e70d6dbadd8e8 (patch)
tree12baf4ae489e7afd4819ec94bc413c1c2a1db05d /tests/ldebug.js
parent2e5b595a2e04fe72555a565af4aae43560946473 (diff)
downloadfengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.tar.gz
fengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.tar.bz2
fengari-456ab7b69f88859683c60cc2261e70d6dbadd8e8.zip
8-bit string internally tests
Lexing/Parsing is done on byte rather than js strings
Diffstat (limited to 'tests/ldebug.js')
-rw-r--r--tests/ldebug.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/ldebug.js b/tests/ldebug.js
index 0261305..e24b584 100644
--- a/tests/ldebug.js
+++ b/tests/ldebug.js
@@ -30,7 +30,7 @@ test('luaG_typeerror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
@@ -38,7 +38,7 @@ test('luaG_typeerror', function (t) {
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to get length of a boolean value (local 'a')"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to get length of a boolean value (local 'a')"),
"Correct error was thrown"
);
});
@@ -60,14 +60,14 @@ test('luaG_typeerror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
"Correct error was thrown"
);
});
@@ -89,14 +89,14 @@ test('luaG_typeerror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
"Correct error was thrown"
);
});
@@ -118,14 +118,14 @@ test('luaG_typeerror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to index a boolean value (local 'a')"),
"Correct error was thrown"
);
});
@@ -146,14 +146,14 @@ test('luaG_concaterror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to concatenate a table value"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to concatenate a table value"),
"Correct error was thrown"
);
});
@@ -174,14 +174,14 @@ test('luaG_opinterror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("attempt to perform arithmetic on a string value"),
+ lapi.lua_tojsstring(L, -1).endsWith("attempt to perform arithmetic on a string value"),
"Correct error was thrown"
);
});
@@ -202,14 +202,14 @@ test('luaG_tointerror', function (t) {
linit.luaL_openlibs(L);
- lapi.lua_load(L, null, bc, "test-typeerror", "binary");
+ lapi.lua_load(L, null, bc, lua.to_luastring("test-typeerror"), lua.to_luastring("binary"));
lapi.lua_pcall(L, 0, -1, 0);
}, "JS Lua program ran without error");
t.ok(
- lapi.lua_tostring(L, -1).endsWith("number has no integer representation"),
+ lapi.lua_tojsstring(L, -1).endsWith("number has no integer representation"),
"Correct error was thrown"
);
-}); \ No newline at end of file
+});