Skip to content

Commit a787a67

Browse files
committed
test(rest): the statement-leak check reads SQL keywords, not the prescription's prose
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UtnxvdiN376GF3sgXwAw4d
1 parent 21a3dfa commit a787a67

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/rest/src/analytics-16019-driver-declared-fault.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,12 @@ describe('[#16019] a driver fault on the raw-SQL path reaches the caller by decl
251251
expect(execute).not.toHaveBeenCalled();
252252
expect(warned.filter((m) => m.includes('[sql-driver] DATABASE_ERROR'))).toHaveLength(0);
253253
// ⛔ The refusal names the path, never the caller's `field` expression text
254-
// or a compiled statement.
254+
// or a compiled statement. The statement check reads the keywords as the
255+
// strategies emit them (upper case): the prescription itself tells the
256+
// author, in prose, to "Group by the column itself".
255257
const body = JSON.stringify(res.body);
256258
expect(body).not.toMatch(/translate/i);
257-
expect(body).not.toMatch(/SELECT|GROUP BY/i);
259+
expect(body).not.toMatch(/\bSELECT\b|\bGROUP BY\b/);
258260
});
259261

260262
it('POSITIVE CONTROL: a legitimate dataset on declared fields → 200 with rows', async () => {

0 commit comments

Comments
 (0)