From 970dbe61ce2e0c46455a89c8fbc75e6eb783d7c9 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 6 Jan 2018 22:19:07 +1100 Subject: tests/test-suite/api.js: Split a skipped test --- tests/test-suite/api.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/test-suite/api.js b/tests/test-suite/api.js index b5f45c3..87f96b3 100644 --- a/tests/test-suite/api.js +++ b/tests/test-suite/api.js @@ -1936,13 +1936,35 @@ test("[test-suite] api: testing memory errors when creating a new state", { skip }, "Lua program ran without error"); }); -test("[test-suite] api: get main thread from registry (at index LUA_RIDX_MAINTHREAD == 1)", { skip: true }, function (t) { +test("[test-suite] api: get main thread from registry (at index LUA_RIDX_MAINTHREAD == 1)", function (t) { let luaCode = ` mt = T.testC("rawgeti R 1; return 1") assert(type(mt) == "thread" and coroutine.running() == mt) + `, L; + + t.plan(2); + t.doesNotThrow(function () { + + L = lauxlib.luaL_newstate(); + lualib.luaL_openlibs(L); + + ltests.luaopen_tests(L); + + lauxlib.luaL_loadstring(L, lua.to_luastring(prefix + memprefix + luaCode)); + }, "Lua program loaded without error"); + + t.doesNotThrow(function () { + + lua.lua_call(L, 0, -1); + + }, "Lua program ran without error"); +}); + +test("[test-suite] api: test thread creation after stressing GC", { skip: true }, function (t) { + let luaCode = ` function expand (n,s) if n==0 then return "" end local e = string.rep("=", n) -- cgit v1.2.3-70-g09d2