diff --git a/tests/backend/codegen-composite.test.ts b/tests/backend/codegen-composite.test.ts index 496c1ec..93300c0 100644 --- a/tests/backend/codegen-composite.test.ts +++ b/tests/backend/codegen-composite.test.ts @@ -12,9 +12,14 @@ */ import { describe, it, expect } from "vitest"; -import { compile } from "../../dist/index.js"; +import { compile } from "../../src/index.js"; -function compileST(source: string): { cppCode: string; headerCode: string; success: boolean; errors: unknown[] } { +function compileST(source: string): { + cppCode: string; + headerCode: string; + success: boolean; + errors: unknown[]; +} { const result = compile(source); return { cppCode: result.cppCode, diff --git a/tests/backend/codegen-control-flow.test.ts b/tests/backend/codegen-control-flow.test.ts index fb6dec8..aa59f87 100644 --- a/tests/backend/codegen-control-flow.test.ts +++ b/tests/backend/codegen-control-flow.test.ts @@ -12,9 +12,14 @@ */ import { describe, it, expect } from "vitest"; -import { compile } from "../../dist/index.js"; - -function compileST(source: string): { cppCode: string; headerCode: string; success: boolean; errors: unknown[] } { +import { compile } from "../../src/index.js"; + +function compileST(source: string): { + cppCode: string; + headerCode: string; + success: boolean; + errors: unknown[]; +} { const result = compile(source); return { cppCode: result.cppCode, @@ -227,7 +232,6 @@ describe("Phase 3.2: CASE Statement Code Generation", () => { expect(result.cppCode).toContain("default:"); }); - it("should generate CASE with enum dot-notation labels using ::", () => { const result = compileST(` TYPE @@ -684,7 +688,7 @@ describe("Phase 3.2: Complex Control Flow", () => { const nsEnd = progSection.indexOf("} // namespace"); const funcSection = nsEnd > 0 ? progSection.slice(0, nsEnd) : progSection; const lines = funcSection.split("\n"); - const elseLines = lines.filter(l => l.trim() === "} else {"); + const elseLines = lines.filter((l) => l.trim() === "} else {"); expect(elseLines.length).toBe(0); }); diff --git a/tests/backend/codegen-dynamic-memory.test.ts b/tests/backend/codegen-dynamic-memory.test.ts index 218f0d9..9e9de79 100644 --- a/tests/backend/codegen-dynamic-memory.test.ts +++ b/tests/backend/codegen-dynamic-memory.test.ts @@ -6,7 +6,7 @@ */ import { describe, it, expect } from "vitest"; -import { compile } from "../../dist/index.js"; +import { compile } from "../../src/index.js"; function compileST(source: string): { cppCode: string; @@ -215,7 +215,8 @@ describe("Phase 3.5: Combined __NEW/__DELETE Usage", () => { expect(result.success).toBe(true); // Should have two iec_new calls and two iec_delete calls const newCount = (result.cppCode.match(/strucpp::iec_new { PROGRAM Main END_PROGRAM `); - expect(result.headerCode).toContain( - "class WORKER : public IRUNNABLE {", - ); + expect(result.headerCode).toContain("class WORKER : public IRUNNABLE {"); }); }); @@ -368,7 +366,10 @@ describe("Codegen - OOP Features (Phase 5.2)", () => { const childSection = result.cppCode.slice( result.cppCode.indexOf("void CHILD::operator()()"), ); - const childBody = childSection.slice(0, childSection.indexOf("\n}\n") + 3); + const childBody = childSection.slice( + 0, + childSection.indexOf("\n}\n") + 3, + ); expect(childBody).not.toContain("BASE::operator()()"); }); }); diff --git a/tests/backend/codegen-vla.test.ts b/tests/backend/codegen-vla.test.ts index fb6124b..296231c 100644 --- a/tests/backend/codegen-vla.test.ts +++ b/tests/backend/codegen-vla.test.ts @@ -7,7 +7,7 @@ */ import { describe, it, expect } from "vitest"; -import { compile } from "../../dist/index.js"; +import { compile } from "../../src/index.js"; function compileST(source: string): { cppCode: string; diff --git a/tests/backend/test-main-gen.test.ts b/tests/backend/test-main-gen.test.ts index 3a3d2c5..67ad786 100644 --- a/tests/backend/test-main-gen.test.ts +++ b/tests/backend/test-main-gen.test.ts @@ -5,9 +5,9 @@ */ import { describe, it, expect } from "vitest"; -import { generateTestMain } from "../../dist/backend/test-main-gen.js"; -import type { POUInfo } from "../../dist/backend/test-main-gen.js"; -import type { TestFile } from "../../dist/testing/test-model.js"; +import { generateTestMain } from "../../src/backend/test-main-gen.js"; +import type { POUInfo } from "../../src/backend/test-main-gen.js"; +import type { TestFile } from "../../src/testing/test-model.js"; /** Helper to create a basic POUInfo for a program */ function programPOU(name: string, vars: Record = {}): POUInfo { @@ -28,7 +28,13 @@ function makeTestFile( } /** Default source span */ -const span = { file: "test.st", startLine: 1, endLine: 1, startCol: 1, endCol: 1 }; +const span = { + file: "test.st", + startLine: 1, + endLine: 1, + startCol: 1, + endCol: 1, +}; describe("Test Main Generator", () => { describe("basic generation", () => { diff --git a/tests/library/codesys-import.test.ts b/tests/library/codesys-import.test.ts index d0ca0d3..affc64f 100644 --- a/tests/library/codesys-import.test.ts +++ b/tests/library/codesys-import.test.ts @@ -16,16 +16,13 @@ import { readLEB128, formatPOU, pouToSources, -} from "../../dist/library/codesys-import/index.js"; -import type { ExtractedPOU } from "../../dist/library/codesys-import/index.js"; +} from "../../src/library/codesys-import/index.js"; +import type { ExtractedPOU } from "../../src/library/codesys-import/index.js"; // Path to CODESYS library fixtures checked into the repository const FIXTURES_DIR = resolve(__dirname, "../fixtures/codesys"); const OSCAT_V23_PATH = resolve(FIXTURES_DIR, "oscat_basic_335.lib"); -const OSCAT_V3_PATH = resolve( - FIXTURES_DIR, - "oscat_basic_335_codesys3.library", -); +const OSCAT_V3_PATH = resolve(FIXTURES_DIR, "oscat_basic_335_codesys3.library"); const V23_REFERENCE_DIR = resolve(FIXTURES_DIR, "v23-reference"); describe("detectFormat", () => {