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/strings.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'tests/test-suite/strings.js') diff --git a/tests/test-suite/strings.js b/tests/test-suite/strings.js index 0efedcb..cbffe5c 100644 --- a/tests/test-suite/strings.js +++ b/tests/test-suite/strings.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 checkerror = ` local maxi, mini = math.maxinteger, math.mininteger @@ -45,7 +45,7 @@ test('[test-suite] strings: string comparisons', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -87,7 +87,7 @@ test('[test-suite] strings: string.sub', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -125,7 +125,7 @@ test('[test-suite] strings: string.find', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -157,7 +157,7 @@ test('[test-suite] strings: string.len and #', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -214,7 +214,7 @@ test('[test-suite] strings: string.byte/string.char', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -251,7 +251,7 @@ test('[test-suite] strings: repetitions with separator', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -303,7 +303,7 @@ test('[test-suite] strings: tostring', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -350,7 +350,7 @@ test('[test-suite] strings: string.format', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -391,7 +391,7 @@ test('[test-suite] strings: %q', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -418,7 +418,7 @@ test('[test-suite] strings: embedded zeros error', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -461,7 +461,7 @@ test('[test-suite] strings: format x tostring', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -498,7 +498,7 @@ test('[test-suite] strings: longest number that can be formatted', function (t) lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -547,7 +547,7 @@ test('[test-suite] strings: large numbers for format', function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -604,7 +604,7 @@ test("[test-suite] strings: 'format %a %A'", function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -644,7 +644,7 @@ test("[test-suite] strings: errors in format", function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -695,7 +695,7 @@ test("[test-suite] strings: table.concat", function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -751,7 +751,7 @@ test.skip("[test-suite] strings: locale", function (t) { lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); @@ -782,7 +782,7 @@ test("[test-suite] strings: bug in Lua 5.3.2: 'gmatch' iterator does not work ac lualib.luaL_openlibs(L); - lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode)); + lauxlib.luaL_loadstring(L, to_luastring(checkerror + luaCode)); }, "Lua program loaded without error"); -- cgit v1.2.3-54-g00ecf