aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-19 00:23:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-19 00:26:36 +1000
commit043b6096bcf36596cef92b22739f5f3a61f7ff42 (patch)
tree3e426c128d002401ff8c4289440ce0a808276799
parentfc242475e4e76b73bbfcba7668ee6e716009243a (diff)
downloadfengari-043b6096bcf36596cef92b22739f5f3a61f7ff42.tar.gz
fengari-043b6096bcf36596cef92b22739f5f3a61f7ff42.tar.bz2
fengari-043b6096bcf36596cef92b22739f5f3a61f7ff42.zip
tests/test-suite/inprogress/db.js: Give snippet a file-based source rather than a string
Test was failing due to short_src containing '...'
-rw-r--r--tests/test-suite/inprogress/db.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/test-suite/inprogress/db.js b/tests/test-suite/inprogress/db.js
index b6ac68b..961014b 100644
--- a/tests/test-suite/inprogress/db.js
+++ b/tests/test-suite/inprogress/db.js
@@ -973,12 +973,11 @@ test("[test-suite] db: testing debugging of coroutines", function (t) {
local co = coroutine.create(f)
coroutine.resume(co, 3)
- -- TODO: will fail because of filename not being db.lua
- -- checktraceback(co, {"yield", "db.lua", "db.lua", "db.lua", "db.lua"})
- -- checktraceback(co, {"db.lua", "db.lua", "db.lua", "db.lua"}, 1)
- -- checktraceback(co, {"db.lua", "db.lua", "db.lua"}, 2)
- -- checktraceback(co, {"db.lua"}, 4)
- -- checktraceback(co, {}, 40)
+ checktraceback(co, {"yield", "db.lua", "db.lua", "db.lua", "db.lua"})
+ checktraceback(co, {"db.lua", "db.lua", "db.lua", "db.lua"}, 1)
+ checktraceback(co, {"db.lua", "db.lua", "db.lua"}, 2)
+ checktraceback(co, {"db.lua"}, 4)
+ checktraceback(co, {}, 40)
co = coroutine.create(function (x)
@@ -1031,7 +1030,9 @@ test("[test-suite] db: testing debugging of coroutines", function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ let b = lua.to_luastring(luaCode);
+ if (lauxlib.luaL_loadbuffer(L, b, b.length, lua.to_luastring("@db.lua")) !== lua.LUA_OK)
+ throw Error(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");
@@ -1303,7 +1304,9 @@ test("[test-suite] db: testing traceback sizes", function (t) {
lualib.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ let b = lua.to_luastring(luaCode);
+ if (lauxlib.luaL_loadbuffer(L, b, b.length, lua.to_luastring("@db.lua")) !== lua.LUA_OK)
+ throw Error(lua.lua_tojsstring(L, -1));
}, "Lua program loaded without error");