summaryrefslogtreecommitdiff
path: root/tests/lauxlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-04-20 21:16:24 +1000
committerdaurnimator <quae@daurnimator.com>2018-04-20 21:16:24 +1000
commita260f381d30e036b39078fee0295e539067c10a3 (patch)
tree4f3b2ecb264ec8dd29cac74d23223d15d297eb8e /tests/lauxlib.js
parentfe9b43374c2e8dc28df0ce460aefaf50b933aaa7 (diff)
parent9f5d4d35de0b88334bba7c11a9e960a19ee0740b (diff)
downloadfengari-a260f381d30e036b39078fee0295e539067c10a3.tar.gz
fengari-a260f381d30e036b39078fee0295e539067c10a3.tar.bz2
fengari-a260f381d30e036b39078fee0295e539067c10a3.zip
Merge branch 'test-with-jest'
Diffstat (limited to 'tests/lauxlib.js')
-rw-r--r--tests/lauxlib.js29
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/lauxlib.js b/tests/lauxlib.js
deleted file mode 100644
index 8d57ecb..0000000
--- a/tests/lauxlib.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-const test = require('tape');
-
-const lua = require('../src/lua.js');
-const lauxlib = require("../src/lauxlib.js");
-const {to_luastring} = require("../src/fengaricore.js");
-
-test('luaL_ref, lua_rawgeti, luaL_unref, LUA_REGISTRYINDEX', function (t) {
- let L;
-
- t.plan(2);
-
- t.doesNotThrow(function () {
- L = lauxlib.luaL_newstate();
- lua.lua_pushstring(L, to_luastring("hello references!"));
-
- let r = lauxlib.luaL_ref(L, lua.LUA_REGISTRYINDEX); // pops a value, stores it and returns a reference
- lua.lua_rawgeti(L, lua.LUA_REGISTRYINDEX, r); // pushes a value associated with the reference
- lauxlib.luaL_unref(L, lua.LUA_REGISTRYINDEX, r); // releases the reference
-
- }, "JS Lua program ran without error");
-
- t.strictEqual(
- lua.lua_tojsstring(L, -1),
- "hello references!",
- "top is correct"
- );
-});