Repository navigation
Commit c137906
committed
tools: pin the undecodable-byte offsets against the message's own delimiter
CodeRabbit's row on eb15d53 (thread on applyDiffTool.failureReporting.spec.ts:245) is right on both counts, and the
second is a defect in my assertions rather than in the tool:
* `expect(output).toContain("first undecodable byte at offset 1")` is also satisfied by a message reading
"offset 10", because the shorter string is a prefix of the longer one. The reported offset is followed in the
message by `).`, so every offset assertion in `bytes the decoder cannot read` now asserts
"first undecodable byte at offset N)." - eight assertions, including the two rows that were already there.
* The adjacency cases it asked for are added in both orders: a truncated sequence followed by a literal U+FFFD
(`e2 82 ef bf bd`) reports offset 0, the start byte of the truncated sequence, and a literal U+FFFD followed
by a truncated sequence (`61 ef bf bd e2 82`) reports offset 4 where counting through the decoded string
would report 3 - the same three-byte-to-one-character shortfall the previous commit fixed, now pinned with a
literal replacement character instead of a byte-order mark. Offsets are quoted against the byte positions a
hex dump shows.
Verification, pinned node v22.23.4 with stdio on file descriptors:
- applyDiffTool.failureReporting.spec.ts: 46 passed (1 file), 44 before this commit plus the two adjacency rows.
- tsc --noEmit -p tsconfig.json in src: 0 errors; eslint --prune-suppressions --max-warnings=0: 0 on both files, with its
rewrite of src/eslint-suppressions.json reverted so no suppression churn rides along; prettier --check clean, formatted
before measuring.
- The merge candidate (this head onto upstream/main e487cd7, which is what pull_request CI checks out) is built and
run locally before the push - both applyDiffTool specs there, including main's own outsideWorkspace.spec.ts - because a
head-only green run describes a tree CI does not test.
Gate: 355 of 500 counted executable lines at base 73931fe with base...head and --unified=0
on the formatted tree with node v22.23.4 - unchanged from eb15d53, because every line here is in __tests__, which the
gate excludes. Mutation state is unchanged by this commit and is still the one published on the PR: 347 lines / 318 valid
/ 255 killed / 4 timeout / 57 survived / 2 no coverage from the artifact at d5c31a1, and no run has measured this
head yet.1 parent eb15d53 commit c137906
1 file changed
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
265 | 281 | | |
266 | 282 | | |
267 | 283 | | |
| |||
0 commit comments