TestParseInt_SignOnlyTripwire_KI2 reproduces the live failure mode tracked as KnownIssue KI-2 / DEFECT-260726-3F95. It PASSES while the bug is present (ParseInt("-") returns (0, nil)) and FAILS the moment the one-line guard lands in bytes.go:parseInt, at which point KI-2 must be flipped to status: f
(t *testing.T)
| 2455 | // |
| 2456 | // Reproduces: KI-2 |
| 2457 | func TestParseInt_SignOnlyTripwire_KI2(t *testing.T) { |
| 2458 | v, err := ParseInt([]byte("-")) |
| 2459 | // Tripwire: while the bug is present, the call returns (0, nil). |
| 2460 | if err != nil { |
| 2461 | t.Fatalf("KI-2 tripwire no longer reproduces: ParseInt(\"-\") err = %v (the bug has been FIXED — flip KI-2 to status: fixed and delete this tripwire)", err) |
| 2462 | } |
| 2463 | if v != 0 { |
| 2464 | t.Fatalf("KI-2 tripwire no longer reproduces: ParseInt(\"-\") v = %d (the bug has been FIXED — flip KI-2 to status: fixed and delete this tripwire)", v) |
| 2465 | } |
| 2466 | // Also exercise the `+`-prefixed variant for documentation: parseInt does |
| 2467 | // not treat `+` as a sign, so it hits the c < '0' branch and correctly |
| 2468 | // returns MalformedValueError. This row pins the asymmetry so a future |
| 2469 | // fix that accidentally widened the sign classifier surfaces here too. |
| 2470 | if _, err := ParseInt([]byte("+")); err == nil { |
| 2471 | t.Fatalf("ParseInt(\"+\") unexpectedly returned nil error — `+` is not a JSON number prefix") |
| 2472 | } |
| 2473 | } |
| 2474 | |
| 2475 | // Reproduces: KI-4 |
| 2476 | // TestSetTopLevelArrayBeyondLength_KI4 documents the open design gap |
nothing calls this directly
no test coverage detected