From f7e5203a20ef41cf9bc59d339b4f85007a7f3764 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 15 May 2017 17:20:06 +1000 Subject: Separate ZIO and MBuffer data structures - lua_load no longer takes a null reader function --- tests/lcorolib.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'tests/lcorolib.js') diff --git a/tests/lcorolib.js b/tests/lcorolib.js index 342b560..4faf13b 100644 --- a/tests/lcorolib.js +++ b/tests/lcorolib.js @@ -2,9 +2,6 @@ const test = require('tape'); -const tests = require("./tests.js"); -const toByteCode = tests.toByteCode; - const lua = require('../src/lua.js'); const lauxlib = require('../src/lauxlib.js'); const lualib = require('../src/lualib.js'); @@ -28,13 +25,11 @@ test('coroutine.create, coroutine.yield, coroutine.resume', function (t) { t.doesNotThrow(function () { - let bc = toByteCode(luaCode); - L = lauxlib.luaL_newstate(); lualib.luaL_openlibs(L); - lua.lua_load(L, null, bc, lua.to_luastring("test-coroutine"), lua.to_luastring("binary")); + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); lua.lua_call(L, 0, -1); @@ -71,13 +66,11 @@ test('coroutine.status', function (t) { t.doesNotThrow(function () { - let bc = toByteCode(luaCode); - L = lauxlib.luaL_newstate(); lualib.luaL_openlibs(L); - lua.lua_load(L, null, bc, lua.to_luastring("test-coroutine.status"), lua.to_luastring("binary")); + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); lua.lua_call(L, 0, -1); @@ -112,13 +105,11 @@ test('coroutine.isyieldable', function (t) { t.doesNotThrow(function () { - let bc = toByteCode(luaCode); - L = lauxlib.luaL_newstate(); lualib.luaL_openlibs(L); - lua.lua_load(L, null, bc, lua.to_luastring("test-coroutine.isyieldable"), lua.to_luastring("binary")); + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); lua.lua_call(L, 0, -1); @@ -153,13 +144,11 @@ test('coroutine.running', function (t) { t.doesNotThrow(function () { - let bc = toByteCode(luaCode); - L = lauxlib.luaL_newstate(); lualib.luaL_openlibs(L); - lua.lua_load(L, null, bc, lua.to_luastring("test-coroutine.running"), lua.to_luastring("binary")); + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); lua.lua_call(L, 0, -1); @@ -194,13 +183,11 @@ test('coroutine.wrap', function (t) { t.doesNotThrow(function () { - let bc = toByteCode(luaCode); - L = lauxlib.luaL_newstate(); lualib.luaL_openlibs(L); - lua.lua_load(L, null, bc, lua.to_luastring("test-coroutine.wrap"), lua.to_luastring("binary")); + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); lua.lua_call(L, 0, -1); -- cgit v1.2.3-54-g00ecf