summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-17 17:25:37 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-17 17:25:37 +1000
commitb32d8ec4d12f48ff4930f5b98b744661f974b0d4 (patch)
treeb9507f3edfe118bcb671cdfbd7e5502d6707d9a7 /tests
parent5db25d79b8f2aeaed38e890bce5221cc4e35b77d (diff)
downloadfengari-b32d8ec4d12f48ff4930f5b98b744661f974b0d4.tar.gz
fengari-b32d8ec4d12f48ff4930f5b98b744661f974b0d4.tar.bz2
fengari-b32d8ec4d12f48ff4930f5b98b744661f974b0d4.zip
tests/test-suite/pm.js: Use luaL_loadfile instead of loadstring containing loadfile
Diffstat (limited to 'tests')
-rw-r--r--tests/test-suite/pm.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/test-suite/pm.js b/tests/test-suite/pm.js
index a8a58cd..6b9c767 100644
--- a/tests/test-suite/pm.js
+++ b/tests/test-suite/pm.js
@@ -202,11 +202,8 @@ test("[test-suite] pm: range", function (t) {
// Can't be represented by JS string, testing from actual lua file
test("[test-suite] pm: classes", function (t) {
- let luaCode = `
- local f = loadfile("tests/test-suite/pm-classes.lua")
- return f()
- `, L;
-
+ let L;
+
t.plan(2);
t.doesNotThrow(function () {
@@ -215,7 +212,7 @@ test("[test-suite] pm: classes", function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadfile(L, lua.to_luastring("tests/test-suite/pm-classes.lua"));
}, "Lua program loaded without error");
@@ -229,11 +226,8 @@ test("[test-suite] pm: classes", function (t) {
// Can't be represented by JS string, testing from actual lua file
test("[test-suite] pm: gsub", function (t) {
- let luaCode = `
- local f = loadfile("tests/test-suite/pm-gsub.lua")
- return f()
- `, L;
-
+ let L;
+
t.plan(2);
t.doesNotThrow(function () {
@@ -242,7 +236,7 @@ test("[test-suite] pm: gsub", function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadfile(L, lua.to_luastring("tests/test-suite/pm-gsub.lua"));
}, "Lua program loaded without error");