Commit 6935da6
committed
test(spec): make the pin enforce the whole sentence its comment promises
The comment said the wrong tool may appear "ONLY as the correction naming it
wrong — never as a command to run", but the assertion under it was
`not.toMatch(/^\s*pnpm sdui:manifest/m)`, which enforces only the second half.
Measured against the real generated text: the original defective claim
("`pnpm sdui:manifest` rewrites it when .objectui-sha moves") is itself MID-LINE,
so the line-anchored form does not match it at all — it was caught only by the
positive pins beside it. Prose asserting more than the code does, inside a change
about prose asserting more than the tree does.
The lookahead form enforces the whole sentence and catches the mid-line shape on
its own. Measured on all three texts before it was written, via the real
manifestPrescription() output rather than a hand-typed fixture:
present branch anchored: false lookahead: false (assertion passes)
defective anchored: FALSE lookahead: TRUE (only the new form catches it)
absent branch anchored: true lookahead: true
The absent branch legitimately opens command lines with that spelling, which is why
this assertion stays inside the present-branch leg and must not be hoisted; a flat
`not.toContain` is unavailable in the other direction, since it would forbid the
correction itself.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016N6xmWt5hYm94ffVEwGH8x1 parent 0e73d7f commit 6935da6
1 file changed
Lines changed: 11 additions & 5 deletions
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
575 | 581 | | |
576 | 582 | | |
577 | 583 | | |
| |||
0 commit comments