summaryrefslogtreecommitdiff
path: root/tests/lcorolib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-15 17:20:06 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-15 17:20:06 +1000
commitf7e5203a20ef41cf9bc59d339b4f85007a7f3764 (patch)
tree3c6f0907231588f528902eec3b2b1d09d19a53e1 /tests/lcorolib.js
parent3947c2cb2fa6193645ac30898064e3d335a63545 (diff)
downloadfengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.tar.gz
fengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.tar.bz2
fengari-f7e5203a20ef41cf9bc59d339b4f85007a7f3764.zip
Separate ZIO and MBuffer data structures
- lua_load no longer takes a null reader function
Diffstat (limited to 'tests/lcorolib.js')
-rw-r--r--tests/lcorolib.js23
1 files changed, 5 insertions, 18 deletions
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);