Skip to content

Commit 5ecd14b

Browse files
sahrizviclaude
andcommitted
test(validate): sql.fix reports success=false with a fixed_sql when nothing needed fixing
Guard on "the handler ran and returned SQL" instead. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012Q51zFUmPg1WwtS5CrGJE6
1 parent e896d70 commit 5ecd14b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/opencode/test/altimate/validate-identifier-case.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,11 @@ from "TPCH_ANALYTICS"."PUBLIC_REPORTING"."RPT_MONTHLY_SALES_BY_REGION" where "OR
291291
["altimate_core.correct", { sql: quoted, schema_context: UPPER }],
292292
] as const) {
293293
const r = await D.call(method as never, params as never)
294-
expect(r.success, method).toBe(true) // a handler that errored would pass the spelling checks vacuously
294+
// A handler that errored would pass the spelling checks vacuously. `sql.fix` reports
295+
// `success: false` with a `fixed_sql` when there was nothing to fix, so the guard
296+
// is "the handler ran and returned SQL", not `success` alone.
297+
expect(r.success === true || typeof r.fixed_sql === "string", method).toBe(true)
298+
expect(JSON.stringify(r), method).not.toContain("native handler")
295299
const text = JSON.stringify(r)
296300
expect(text, method).not.toMatch(/"\\"(order_month|customer_region|net_revenue|rpt_monthly_sales_by_region)\\""/)
297301
expect(text, method).not.toContain('\\"order_month\\"')

0 commit comments

Comments
 (0)