Skip to content

Commit

Permalink
Move compiler tests one folder up in hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismaltby committed Sep 19, 2024
1 parent 05a7e4e commit d2cc67e
Show file tree
Hide file tree
Showing 54 changed files with 23 additions and 35 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
dummySceneResource,
dummyTriggerPrefabResource,
dummyTriggerResource,
} from "../../dummydata";
} from "../dummydata";

describe("applyPrefabs", () => {
it("should apply actor prefabs correctly", () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
import compile, {
precompileBackgrounds,
precompileScenes,
} from "../../../src/lib/compiler/compileData";
} from "../../src/lib/compiler/compileData";
import {
compileSceneProjectiles,
PrecompiledBackground,
PrecompiledScene,
PrecompiledSprite,
} from "../../../src/lib/compiler/generateGBVMData";
import { EVENT_TEXT, EVENT_IF_TRUE } from "../../../src/consts";
} from "../../src/lib/compiler/generateGBVMData";
import { EVENT_TEXT, EVENT_IF_TRUE } from "../../src/consts";
import { projectileStateTest } from "./_files/data/projectiles";
import { getTestScriptHandlers } from "../../getTestScriptHandlers";
import { getTestScriptHandlers } from "../getTestScriptHandlers";
import { ProjectResources } from "shared/lib/resources/types";
import {
BackgroundData,
Expand All @@ -23,7 +23,7 @@ import {
dummyBackground,
dummyScene,
dummyScriptEvent,
} from "../../dummydata";
} from "../dummydata";
import os from "os";

test("should take into account state value when building projectiles", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import compileEntityEvents from "../../../src/lib/compiler/compileEntityEvents";
import { EVENT_END, EVENT_TEXT, EVENT_IF_TRUE } from "../../../src/consts";
import { getDummyCompiledFont } from "../../dummydata";
import { getTestScriptHandlers } from "../../getTestScriptHandlers";
import compileEntityEvents from "../../src/lib/compiler/compileEntityEvents";
import { EVENT_END, EVENT_TEXT, EVENT_IF_TRUE } from "../../src/consts";
import { getDummyCompiledFont } from "../dummydata";
import { getTestScriptHandlers } from "../getTestScriptHandlers";

jest.mock("../../../src/consts");
jest.mock("../../src/consts");

test("should compile empty events", async () => {
const scriptEventHandlers = await getTestScriptHandlers();
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { determineUsedAssets } from "lib/compiler/precompile/determineUsedAssets";
import { CustomEvent, FontData } from "shared/lib/entities/entitiesTypes";
import { getTestScriptHandlers } from "../../getTestScriptHandlers";
import { dummyProjectResources, dummySceneResource } from "../../dummydata";
import { getTestScriptHandlers } from "../getTestScriptHandlers";
import { dummyProjectResources, dummySceneResource } from "../dummydata";
import {
FontResource,
ProjectResources,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
replaceBank,
toCartSize,
toOutputFilename,
} from "../../../src/lib/compiler/gbspack";
} from "../../src/lib/compiler/gbspack";

describe("Parse", () => {
it("should parse area size", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,11 @@ _scene_1_init::

it("should give equal output for functionally identical scripts", async () => {
const input1 = await readFile(
path.resolve(
__dirname,
"../../data/compiler/_files/data/script_input_953.s"
),
path.resolve(__dirname, "_files/data/script_input_953.s"),
"utf8"
);
const input2 = await readFile(
path.resolve(
__dirname,
"../../data/compiler/_files/data/script_input_954.s"
),
path.resolve(__dirname, "_files/data/script_input_954.s"),
"utf8"
);

Expand All @@ -148,17 +142,11 @@ _scene_1_init::

it("should give equal output for functionally more identical scripts", async () => {
const input1 = await readFile(
path.resolve(
__dirname,
"../../data/compiler/_files/data/script_timer_40.s"
),
path.resolve(__dirname, "_files/data/script_timer_40.s"),
"utf8"
);
const input2 = await readFile(
path.resolve(
__dirname,
"../../data/compiler/_files/data/script_timer_54.s"
),
path.resolve(__dirname, "_files/data/script_timer_54.s"),
"utf8"
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { PrecompiledScene } from "../../../src/lib/compiler/generateGBVMData";
import { PrecompiledScene } from "../../src/lib/compiler/generateGBVMData";
import ScriptBuilder, {
ScriptBuilderOptions,
} from "../../../src/lib/compiler/scriptBuilder";
} from "../../src/lib/compiler/scriptBuilder";
import {
CustomEvent,
ScriptEvent,
} from "../../../src/shared/lib/entities/entitiesTypes";
} from "../../src/shared/lib/entities/entitiesTypes";
import {
dummyActorNormalized,
dummyPrecompiledBackground,
dummyPrecompiledSpriteSheet,
getDummyCompiledFont,
} from "../../dummydata";
import { getTestScriptHandlers } from "../../getTestScriptHandlers";
} from "../dummydata";
import { getTestScriptHandlers } from "../getTestScriptHandlers";

test("Should be able to set active actor to player", async () => {
const output: string[] = [];
Expand Down

0 comments on commit d2cc67e

Please sign in to comment.