diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lvm.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/lvm.js b/tests/lvm.js index 6ee348d..ffd128d 100644 --- a/tests/lvm.js +++ b/tests/lvm.js @@ -63,4 +63,28 @@ test('LOADK, RETURN', function (t) { "hello world", "Program output is correct" ); +}); + + +test('MOV', function (t) { + let luaCode = ` + local a = "hello world" + local b = a + return b + `, vm; + + t.plan(1); + + t.comment("Running following code: \n" + luaCode); + + // t.doesNotThrow(function () { + vm = getVM(luaCode); + vm.execute(); + // }, "Program executed without errors"); + + t.strictEqual( + vm.L.stack[0].value, + "hello world", + "Program output is correct" + ); });
\ No newline at end of file |