feat: expand sudoku analysis and interoperability

This commit is contained in:
2026-08-30 23:21:56 +02:00
parent 4a9869baa0
commit 8ca9300ab3
73 changed files with 12482 additions and 384 deletions
+44
View File
@@ -0,0 +1,44 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { SolveWorkspace } from "../../src/components/SolveWorkspace";
import type { ExactSolveResult } from "../../src/solver";
const limited: ExactSolveResult = {
solutions: [],
count: 0,
truncated: true,
limitReason: "timeout",
nodes: 100,
elapsedMs: 10_000,
};
describe("solve result reporting", () => {
it("does not report zero solutions at a safety limit as unsatisfiable", () => {
const props = {
size: 9,
busy: false,
onLogical: vi.fn(),
onExact: vi.fn(),
onApplyValues: vi.fn(),
onFocusCells: vi.fn(),
};
const { rerender } = render(<SolveWorkspace {...props} exact={limited} />);
expect(
screen.getByText(/solvability is not established/u),
).toBeInTheDocument();
expect(
screen.queryByText("No completion satisfies every supported rule."),
).not.toBeInTheDocument();
rerender(
<SolveWorkspace
{...props}
exact={{ ...limited, truncated: false, limitReason: undefined }}
/>,
);
expect(
screen.getByText("No completion satisfies every supported rule."),
).toBeInTheDocument();
});
});