Consolidate maki and mordern skin reference files

This commit is contained in:
Jordan Eldredge 2019-07-20 21:28:35 -07:00
parent 7bede9cd5a
commit 21caf927c7
88 changed files with 9 additions and 10 deletions

View file

@ -15,9 +15,9 @@
"build": "react-scripts build",
"test": "react-scripts test --no-watchman",
"eject": "react-scripts eject",
"decompile": "cd src/maki-interpreter/reference/maki_decompiler_1.1 && perl mdc.pl \"../../reference/maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.maki\"",
"interpret": "node ./src/maki-interpreter/cli.js \"./reference/maki_compiler/v1.1.13 (Winamp 5.02)/hello_world.maki\"",
"debug": "node --inspect-brk ./src/maki-interpreter/cli.js ./reference/maki_compiler/v1.1.13 (Winamp 5.02)/hello_world.maki"
"decompile": "cd resources/maki_decompiler_1.1 && perl mdc.pl \"../maki_compiler/v1.1.1.b3 (Winamp 3.0 full)/basicTests.maki\"",
"interpret": "node ./src/maki-interpreter/cli.js \"./resources/maki_compiler/v1.1.13 (Winamp 5.02)/hello_world.maki\"",
"debug": "node --inspect-brk ./src/maki-interpreter/cli.js ./resources/maki_compiler/v1.1.13 (Winamp 5.02)/hello_world.maki"
},
"eslintConfig": {
"extends": "react-app"

View file

@ -5,7 +5,8 @@ const runtime = require("../runtime");
const interpret = require("./interpreter");
const { VERSIONS } = require("./testConstants");
async function runFile(relativePath) {
async function runFile(version, fileName) {
const relativePath = `../../resources/maki_compiler/${version}/${fileName}`;
const system = new System();
const data = fs.readFileSync(path.join(__dirname, relativePath));
// Remove this await when we can run the VM synchronously.
@ -42,7 +43,7 @@ describe("can call messageBox with hello World", () => {
test(`with bytecode compiled by ${version}`, async () => {
// Remove this await when we can run the VM synchronously.
// See GitHub issue #814
await runFile(`./reference/maki_compiler/${version}/hello_world.maki`);
await runFile(version, "hello_world.maki");
expect(mockMessageBox).toHaveBeenCalledTimes(1);
expect(mockMessageBox).toHaveBeenCalledWith(
"Hello World",
@ -68,7 +69,7 @@ describe("can use basic operators", () => {
test(`with basic test bytecode compiled by ${version}`, async () => {
// Remove this await when we can run the VM synchronously.
// See GitHub issue #814
await runFile(`./reference/maki_compiler/${version}/basicTests.maki`);
await runFile(version, "basicTests.maki");
expect(mockMessageBox.mock.calls).toEqual(
[
"2 + 2 = 4",
@ -149,9 +150,7 @@ describe("can use simple functions", () => {
test(`with bytecode compiled by ${version}`, async () => {
// Remove this await when we can run the VM synchronously.
// See GitHub issue #814
await runFile(
`./reference/maki_compiler/${version}/simpleFunctions.maki`
);
await runFile(version, "simpleFunctions.maki");
expect(mockMessageBox.mock.calls).toEqual(
[
"simple custom function",

View file

@ -29,7 +29,7 @@ describe("can parse without crashing", () => {
versions.forEach(version => {
test(`compiled with compiler version ${version}`, () => {
expect(() => {
parseFile(`./reference/maki_compiler/${version}/${script}`);
parseFile(`../../resources/maki_compiler/${version}/${script}`);
}).not.toThrow();
});
});