Commit d468f46
fix(bytes): use 7EiB instead of 8EiB in tests — 2^63 overflow is non-portable
Parse("8EiB") computes 2^63, which exceeds MaxInt64. The float-to-int
conversion of out-of-range values is implementation-dependent per the
Go spec, so the prior assertion `math.MaxInt64 == b-1` (relying on
two's-complement wrap) only held on some toolchains. 7EiB fits within
int64 and tests EiB parsing without depending on undefined behaviour.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 309ee6e commit d468f46
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
250 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | | - | |
| 254 | + | |
253 | 255 | | |
254 | | - | |
| 256 | + | |
255 | 257 | | |
256 | | - | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
260 | | - | |
| 262 | + | |
261 | 263 | | |
262 | | - | |
| 264 | + | |
263 | 265 | | |
264 | | - | |
| 266 | + | |
265 | 267 | | |
266 | | - | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
| |||
0 commit comments