summaryrefslogtreecommitdiff
path: root/tests/test-suite/utf8.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-11 23:33:34 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-11 23:35:56 +1100
commita39f24f204a15cb4587e75b38424952fe444d9d2 (patch)
tree5047cd8b5b73bda87142405273c0dcc3203e71f4 /tests/test-suite/utf8.js
parentb0b0b21f4394fabf41d6e3556f455a0a740f3f08 (diff)
downloadfengari-a39f24f204a15cb4587e75b38424952fe444d9d2.tar.gz
fengari-a39f24f204a15cb4587e75b38424952fe444d9d2.tar.bz2
fengari-a39f24f204a15cb4587e75b38424952fe444d9d2.zip
Move fengari specific things to src/fengaricore.js
String manipulation functions now get exposed on 'fengari' object itself at top level
Diffstat (limited to 'tests/test-suite/utf8.js')
-rw-r--r--tests/test-suite/utf8.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test-suite/utf8.js b/tests/test-suite/utf8.js
index 91941bf..173dffd 100644
--- a/tests/test-suite/utf8.js
+++ b/tests/test-suite/utf8.js
@@ -5,7 +5,7 @@ const test = require('tape');
const lua = require('../../src/lua.js');
const lauxlib = require('../../src/lauxlib.js');
const lualib = require('../../src/lualib.js');
-
+const {to_luastring} = require("../../src/fengaricore.js");
const prefix = `
local function checkerror (msg, f, ...)
@@ -107,7 +107,7 @@ test("[test-suite] utf8: offset", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -136,7 +136,7 @@ test("[test-suite] utf8: error indication in utf8.len", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -162,7 +162,7 @@ test("[test-suite] utf8: error in initial position for offset", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -206,7 +206,7 @@ test("[test-suite] utf8: codepoints", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -226,7 +226,7 @@ test("[test-suite] utf8: UTF-8 representation for 0x11ffff (value out of valid r
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -249,7 +249,7 @@ test("[test-suite] utf8: overlong sequences", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -272,7 +272,7 @@ test("[test-suite] utf8: invalid bytes", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -292,7 +292,7 @@ test("[test-suite] utf8: empty strings", function (t) {
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -339,7 +339,7 @@ test("[test-suite] utf8: minimum and maximum values for each sequence size", fun
t.doesNotThrow(function () {
L = lauxlib.luaL_newstate();
lualib.luaL_openlibs(L);
- if (lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
+ if (lauxlib.luaL_loadstring(L, to_luastring(luaCode)) === lua.LUA_ERRSYNTAX)
throw new SyntaxError(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");