refactor(contracts): simplify workflows and drop readiness tool
This commit is contained in:
@@ -1,41 +1,25 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
generateLargeFixture,
|
||||
HOPPER_C_ORACLE,
|
||||
LARGE_FIXTURE_COUNT,
|
||||
sha256,
|
||||
sourceDigest,
|
||||
} from "../../../scripts/lib/conformance-fixtures.mjs";
|
||||
|
||||
describe("source-built conformance fixtures", () => {
|
||||
it("grounds the Hopper semantic oracle in the source-owned C fixture", async () => {
|
||||
const source = await readFile("tests/conformance/c/fixture.c", "utf8");
|
||||
for (const procedure of [
|
||||
HOPPER_C_ORACLE.mainProcedure,
|
||||
HOPPER_C_ORACLE.entryProcedure,
|
||||
HOPPER_C_ORACLE.branchProcedure,
|
||||
HOPPER_C_ORACLE.leafProcedure,
|
||||
])
|
||||
expect(source).toContain(`int ${procedure}`);
|
||||
expect(source).toContain(HOPPER_C_ORACLE.entryString);
|
||||
expect(source).toContain(HOPPER_C_ORACLE.leafString);
|
||||
expect(source).toContain(HOPPER_C_ORACLE.globalName);
|
||||
});
|
||||
|
||||
it("generates a deterministic large complete-inventory fixture", () => {
|
||||
it("generates deterministic large-fixture source", () => {
|
||||
const first = generateLargeFixture();
|
||||
const second = generateLargeFixture();
|
||||
|
||||
expect(first).toBe(second);
|
||||
expect(first.match(/int rea_inventory_/gu)).toHaveLength(
|
||||
LARGE_FIXTURE_COUNT,
|
||||
);
|
||||
expect(first).toContain("rea_inventory_0000");
|
||||
expect(first).toContain("rea_inventory_1204");
|
||||
expect(() => generateLargeFixture(0)).toThrow(/positive integer/u);
|
||||
expect(first).toContain(
|
||||
`rea_inventory_${String(LARGE_FIXTURE_COUNT - 1).padStart(4, "0")}`,
|
||||
);
|
||||
expect(() => generateLargeFixture(0)).toThrow(
|
||||
"Fixture count must be a positive integer",
|
||||
);
|
||||
});
|
||||
|
||||
it("hashes source manifests independently of input ordering", () => {
|
||||
|
||||
Reference in New Issue
Block a user