Commit b012691
refactor(guard): pass the body to isBase64Body; cover the quanta rule
Three cuts, no behaviour change, plus one coverage hole they exposed.
isBase64Body took (block, endMarker) and re-derived the body by slicing
between the first newline and the last END marker — arithmetic the caller
had already done to build the block. It now takes the body itself, which
the caller has in hand as text.slice(m.index + m[0].length, end). Verified
equivalent under both LF and CRLF before applying: the BEGIN match
excludes the \r, so the two slices normalize to the same bytes.
The two `if (remoteControl)` lines merged into one block, and a comment
restating the line below it dropped.
The hole: mutating away the `length % 4` check left the suite GREEN. No
fixture had an alphabet-valid body of the wrong length, so a clause my
previous commit message claimed was covered was not. Two rows added — a
one-character body and `A===` — and both base64 clauses now fail exactly
one test when removed.
175 measured shapes across six sweeps, 0 false accepts, identical to
before the cuts. Full suite 1504 pass / 2 fail (EMFILE, same at the merge
base).
net: -8 lines.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent e28abd0 commit b012691
3 files changed
Lines changed: 18 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
123 | 119 | | |
124 | 120 | | |
125 | 121 | | |
126 | | - | |
| 122 | + | |
127 | 123 | | |
128 | 124 | | |
129 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
| |||
0 commit comments