From 043b6096bcf36596cef92b22739f5f3a61f7ff42 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 19 Jun 2017 00:23:31 +1000 Subject: tests/test-suite/inprogress/db.js: Give snippet a file-based source rather than a string Test was failing due to short_src containing '...' --- tests/test-suite/inprogress/db.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'tests/test-suite/inprogress/db.js') 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"); -- cgit v1.2.3-54-g00ecf