From a39f24f204a15cb4587e75b38424952fe444d9d2 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Thu, 11 Jan 2018 23:33:34 +1100 Subject: Move fengari specific things to src/fengaricore.js String manipulation functions now get exposed on 'fengari' object itself at top level --- tests/test-suite/vararg.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/test-suite/vararg.js') diff --git a/tests/test-suite/vararg.js b/tests/test-suite/vararg.js index dc90248..1cc5ace 100644 --- a/tests/test-suite/vararg.js +++ b/tests/test-suite/vararg.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("[test-suite] vararg: testing vararg", function (t) { let luaCode = ` @@ -73,7 +73,7 @@ test("[test-suite] vararg: testing vararg", function (t) { while i <= lim do a[i] = i; i=i+1 end assert(call(math.max, a) == lim) `, L; - + t.plan(2); t.doesNotThrow(function () { @@ -82,7 +82,7 @@ test("[test-suite] vararg: testing vararg", 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"); @@ -118,7 +118,7 @@ test("[test-suite] vararg: new-style varargs", function (t) { a,b,c,d,e = f(4) assert(a==nil and b==nil and c==nil and d==nil and e==nil) `, L; - + t.plan(2); t.doesNotThrow(function () { @@ -127,7 +127,7 @@ test("[test-suite] vararg: new-style varargs", 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"); @@ -168,7 +168,7 @@ test("[test-suite] vararg: varargs for main chunks", function (t) { pcall(select, 10000) pcall(select, -10000) `, L; - + t.plan(2); t.doesNotThrow(function () { @@ -177,7 +177,7 @@ test("[test-suite] vararg: varargs for main chunks", 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"); @@ -204,7 +204,7 @@ test("[test-suite] vararg: bug in 5.2.2", function (t) { -- assertion fail here f() `, L; - + t.plan(2); t.doesNotThrow(function () { @@ -213,7 +213,7 @@ test("[test-suite] vararg: bug in 5.2.2", 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"); -- cgit v1.2.3-54-g00ecf