Skip to content

Commit 0ffc065

Browse files
committed
test(driver-sql): 跟进 #6210 的 DriverQuery 收窄,并把反向验证计数重测到 d367f03
- `find()` 调用去掉 `object` 键:#6210 把驱动查询参数收窄为 `DriverQuery`, 对象名只由第一个实参给出。没有用 `as any` 绕过——拒收类测试一旦用越契约的 输入构造查询,就不再是在验证调用方真能发出的形状。 - 反向验证计数重测:LIKE 臂停用 → 8 failed / 40 passed;成员臂停用 → 4 failed / 44 passed(此前记的 32 / 36 是首写时对 40 个测试测的)。失败数 两次都不变,是承重的那一半;通过数随邻测增删而漂移,已在注释里说明。 - 补记 analytics 侧同法实测:两个门回退到 main 版本 → 17 failed / 41 passed, 而 `like-metacharacter-escape.test.ts` 在该回退下保持绿——它锁的是两包谓词 之间的一致,拒收文件锁的是门确实调用了谓词,两者都需要。 Refs #5234 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyvqvKMG6asi9aXjKE6xtx
1 parent d6a856b commit 0ffc065

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

‎packages/drivers/driver-sql/src/sql-driver-silent-empty-predicate.test.ts‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,30 @@
4141
* describe do not apply.
4242
*
4343
* Measured by disabling each arm in turn and re-running this file together with
44-
* `sql-driver-out-of-contract-filter-input.test.ts`:
44+
* `sql-driver-out-of-contract-filter-input.test.ts` (48 tests across the two,
45+
* re-measured on `main` at d367f03 — i.e. after #6210's `DriverQuery` narrowing):
4546
*
46-
* - LIKE arm disabled → **8 failed / 32 passed**. The eighth is in the other
47+
* - LIKE arm disabled → **8 failed / 40 passed**. The eighth is in the other
4748
* file: the superseded `{ $startsWith: {} }` pin, which is the point of
4849
* having replaced it rather than deleted it.
49-
* - member arm disabled → **4 failed / 36 passed** — the `$in`, `$nin`,
50+
* - member arm disabled → **4 failed / 44 passed** — the `$in`, `$nin`,
5051
* nested-array and `$between` cases. The `$field` member case is NOT among
5152
* them, and that is the arm ordering being verified rather than a gap:
5253
* #5041's cross-field refusal still answers first for that shape.
5354
*
5455
* The counts are here because a bare "reverting turns it red" claims nothing
5556
* checkable — if a later change makes one of these arms unreachable, the count
56-
* moves and the next reader can see that it did.
57+
* moves and the next reader can see that it did. The FAILURE counts are the
58+
* load-bearing half; the pass counts drift as neighbouring tests are added (they
59+
* read 32 / 36 when this file was first written, against 40 tests).
60+
*
61+
* The analytics side answers the same way, measured the same way: reverting
62+
* `read-scope-sql.ts` and `filter-normalizer.ts` to their pre-#5234 `main`
63+
* versions turns `comparand-shape-refusal.test.ts` **17 failed / 41 passed**.
64+
* `like-metacharacter-escape.test.ts` stays GREEN under that revert, and that is
65+
* correct rather than a hole: it pins the two packages' PREDICATES against each
66+
* other, while this refusal file pins that the doors actually call them. Both
67+
* are needed — parity with nothing calling it is #4984's dead-rule shape.
5768
*
5869
* The row-set assertions are the other half, and they are what makes the
5970
* refusals meaningful rather than self-referential: `keeps` pins that every
@@ -124,8 +135,12 @@ describe('[#5234] SqlDriver refuses the two comparand shapes that compiled to a
124135
for (const row of ROWS) await driver.create('probe', row);
125136
});
126137

138+
// No `object` key: #6210 narrowed the driver query parameter to `DriverQuery`,
139+
// whose object is the first argument and nothing else. Kept in step here rather
140+
// than cast away — a rejection test that builds its query off-contract stops
141+
// exercising the shape a caller can actually send.
127142
const find = (where: unknown) =>
128-
driver.find('probe', { object: 'probe', fields: ['id'], where: where as FilterCondition });
143+
driver.find('probe', { fields: ['id'], where: where as FilterCondition });
129144

130145
const ids = async (where: unknown): Promise<string[]> =>
131146
((await find(where)) as Array<{ id: string }>).map((r) => r.id).sort();

0 commit comments

Comments
 (0)