summaryrefslogtreecommitdiff
path: root/tests/ldblib.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/ldblib.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/ldblib.js')
-rw-r--r--tests/ldblib.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/ldblib.js b/tests/ldblib.js
index 209e60e..8a30e48 100644
--- a/tests/ldblib.js
+++ b/tests/ldblib.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");
test('debug.sethook', function (t) {
let luaCode = `
@@ -32,7 +32,7 @@ test('debug.sethook', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -75,7 +75,7 @@ test('debug.gethook', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -87,7 +87,7 @@ test('debug.gethook', function (t) {
t.deepEqual(
lua.lua_typename(L, lua.lua_type(L, -3)),
- lua.to_luastring("function"),
+ to_luastring("function"),
"Correct element(s) on the stack"
);
@@ -134,7 +134,7 @@ test('debug.getlocal', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -181,7 +181,7 @@ test('debug.setlocal', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -235,7 +235,7 @@ test('debug.upvalueid', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -278,7 +278,7 @@ test('debug.upvaluejoin', function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, to_luastring(luaCode));
}, "Lua program loaded without error");
@@ -322,8 +322,8 @@ test('debug.traceback (with a global)', function (t) {
lualib.luaL_openlibs(L);
- luaCode = lua.to_luastring(luaCode);
- lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, lua.to_luastring("traceback-test"));
+ luaCode = to_luastring(luaCode);
+ lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, to_luastring("traceback-test"));
}, "Lua program loaded without error");
@@ -379,8 +379,8 @@ test('debug.traceback (with a upvalue)', function (t) {
lualib.luaL_openlibs(L);
- luaCode = lua.to_luastring(luaCode);
- lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, lua.to_luastring("traceback-test"));
+ luaCode = to_luastring(luaCode);
+ lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, to_luastring("traceback-test"));
}, "Lua program loaded without error");
@@ -431,8 +431,8 @@ test('debug.getinfo', function (t) {
lualib.luaL_openlibs(L);
- luaCode = lua.to_luastring(luaCode);
- lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, lua.to_luastring("getinfo-test"));
+ luaCode = to_luastring(luaCode);
+ lauxlib.luaL_loadbuffer(L, luaCode, luaCode.length, to_luastring("getinfo-test"));
}, "Lua program loaded without error");