Commit 3632828
refactor(reader): drop redundant
Mutation testing flagged the `offset > fileSize` comparison in both
validateSegmentSpecs and checkBlobBounds as an equivalent mutant — changing
its boundary never changed an outcome. It is genuinely dead: once `length < 0`
is excluded, length >= 0, so an offset past fileSize makes fileSize - offset
negative and the final `length > fileSize - offset` clause already fires. The
clause can never independently decide the result.
This is the same overflow-safe shape as IoBounds.checkRange (which omits the
clause); the parser had hand-rolled the guard and drifted from its own
primitive. Removing it simplifies both predicates and eliminates the
equivalent mutants rather than papering over them with unkillable-by-design
tests. Existing bounds tests stay green and keep their context-named messages.
Reader mutations 110 -> 106 (4 dead mutants gone), killed 90%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>offset > fileSize bounds clause1 parent 35cfddb commit 3632828
1 file changed
Lines changed: 8 additions & 2 deletions
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
0 commit comments