From 456ab7b69f88859683c60cc2261e70d6dbadd8e8 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 29 Mar 2017 14:39:57 +0200 Subject: 8-bit string internally tests Lexing/Parsing is done on byte rather than js strings --- tests/ldebug.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/ldebug.js') 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 +}); -- cgit v1.2.3-54-g00ecf