summaryrefslogtreecommitdiff
path: root/src/vm/instruction.test.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-05-22 23:43:39 -0500
committersanine <sanine.not@pm.me>2023-05-22 23:43:39 -0500
commitc1709249728cb9ad7011b0d39d18ad87d4636f4b (patch)
treed4fae900af8cc4ee2956bbbe3c5c70c1664b193f /src/vm/instruction.test.js
parentd6e89d16d332954dde3fc4c5ee7549af7c8bb556 (diff)
begin testing and make grammar more spec-compliant
Diffstat (limited to 'src/vm/instruction.test.js')
-rw-r--r--src/vm/instruction.test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vm/instruction.test.js b/src/vm/instruction.test.js
new file mode 100644
index 0000000..5dc7eea
--- /dev/null
+++ b/src/vm/instruction.test.js
@@ -0,0 +1,15 @@
+'use strict';
+
+const { Core } = require('./core.js');
+const { DAT } = require('./instruction.js');
+
+
+const CORESIZE = 8000;
+
+
+test('DAT does nothing and kills the program', () => {
+ const core = new Core(CORESIZE);
+ const pc = 0;
+ const ins = core.data[pc];
+ expect(DAT(core, pc, ins)).toEqual([]);
+});