Repository navigation
Commit 099d2d8
test(cli): catalog-conformance asserted the duplicate-name refusal without exercising it
The test was named "composition refuses a duplicate stable name" and its body was
`expect(() => composeCatalog()).not.toThrow()`. That says the three live slices do
not collide today — a true and much weaker statement than its name. Deleting the
guard from `composeCatalog` left the whole file green, which a mutation run
confirms: with the throw disabled, 8 of 9 passed, including that assertion.
`composeCatalog` closes over the module-level `SLICES`, so the refusal was
unreachable from a test at all. The composition is now `composeSlices(slices)`
with `composeCatalog()` calling it with the live three; the guard is unchanged.
Three assertions replace the one: the live slices still compose (kept, under an
honest name), two slices registering the same name throw with BOTH package names
in the message — "there is a collision" is not actionable when three packages
write into one table — and a name registered by exactly one slice is kept, so the
guard refuses a collision rather than any repeat visit.
Re-running the same mutation now fails exactly that test and nothing else.
Note for the record: this file is not a source-text test. Its one file read is
`registry.json`, `JSON.parse`d into a typed model, and every other assertion runs
`composeCatalog` / `listCatalog` / `packageOf` / `stableNameIndex` / `factory()`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cQxyVuTkdPmAduLiedNEg1 parent 3adfa2d commit 099d2d8
2 files changed
Lines changed: 55 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
57 | 71 | | |
58 | 72 | | |
59 | | - | |
| 73 | + | |
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
102 | 138 | | |
103 | 139 | | |
104 | 140 | | |
| |||
0 commit comments