Files
openclaw/extensions/qa-lab/src/parity-shared.test.ts
2026-07-15 05:03:43 +01:00

29 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { compareCapturedToolCallShape } from "./parity-shared.js";
const call = { tool: "image_generate", argsHash: "same-args" };
describe("compareCapturedToolCallShape", () => {
it("accepts exact repeated executions", () => {
expect(compareCapturedToolCallShape([call, call], [call, call])).toBeUndefined();
});
it("accepts a duplicated process-global capture row", () => {
expect(compareCapturedToolCallShape([call, call], [call])).toBeUndefined();
expect(compareCapturedToolCallShape([call, call, call], [call, call])).toBeUndefined();
});
it("preserves execution count for non-image tools", () => {
const readCall = { tool: "read", argsHash: "same-args" };
expect(compareCapturedToolCallShape([readCall, readCall], [readCall])).toBe(
"tool call count differs (2 vs 1)",
);
});
it("preserves canonical execution count", () => {
expect(compareCapturedToolCallShape([call], [call, call])).toBe(
"tool call count differs (1 vs 2)",
);
});
});