diff options
Diffstat (limited to 'tests/ldebug.js')
-rw-r--r-- | tests/ldebug.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/ldebug.js b/tests/ldebug.js new file mode 100644 index 0000000..a6fa55f --- /dev/null +++ b/tests/ldebug.js @@ -0,0 +1,42 @@ +/*jshint esversion: 6 */ +"use strict"; + +const test = require('tape'); +const beautify = require('js-beautify').js_beautify; + +const tests = require("./tests.js"); +const getState = tests.getState; +const toByteCode = tests.toByteCode; + +const lvm = require("../src/lvm.js"); +const ldo = require("../src/ldo.js"); +const lapi = require("../src/lapi.js"); +const lauxlib = require("../src/lauxlib.js"); +const lua = require('../src/lua.js'); +const linit = require('../src/linit.js'); + +test('luaG_typeerror', function (t) { + let luaCode = ` + local a = true + return #a + `, L; + + t.plan(1); + + t.doesNotThrow(function () { + + let bc = toByteCode(luaCode).dataView; + + L = lauxlib.luaL_newstate(); + + linit.luaL_openlibs(L); + + lapi.lua_load(L, bc, "test-typeerror"); + + lapi.lua_pcall(L, 0, -1, 0); + + }, "JS Lua program ran without error"); + + + console.log(lapi.lua_tostring(L, -1)); +});
\ No newline at end of file |