From c1709249728cb9ad7011b0d39d18ad87d4636f4b Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 May 2023 23:43:39 -0500 Subject: begin testing and make grammar more spec-compliant --- src/vm/instruction.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/vm/instruction.test.js (limited to 'src/vm/instruction.test.js') 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([]); +}); -- cgit v1.2.1