summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-21 08:46:48 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-21 09:00:32 +0100
commit23d15010edc905a3b7c123e85ef6d1960d3da039 (patch)
treed66761315763ab9e00cbed78fed69a687e02f5e3 /tests
parent7d58c3b7314e4a63591fa375546cfc76a042e644 (diff)
downloadfengari-23d15010edc905a3b7c123e85ef6d1960d3da039.tar.gz
fengari-23d15010edc905a3b7c123e85ef6d1960d3da039.tar.bz2
fengari-23d15010edc905a3b7c123e85ef6d1960d3da039.zip
luaG_ functions
Diffstat (limited to 'tests')
-rw-r--r--tests/ldebug.js42
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