--------------------------------------------------------------------------- Property: findKeyStart is deterministic on arbitrary bytes --------------------------------------------------------------------------- reqproof:proptest findKeyStart Verifies: SYS-REQ-001 [property]
(t *testing.T)
| 616 | // reqproof:proptest findKeyStart |
| 617 | // Verifies: SYS-REQ-001 [property] |
| 618 | func TestPropertyFindKeyStartDeterminism(t *testing.T) { |
| 619 | r := newRNG(jsonSeed + 8) |
| 620 | const iterations = 2000 |
| 621 | for i := 0; i < iterations; i++ { |
| 622 | raw := randomBytes(r, 64) |
| 623 | key := randKey(r) |
| 624 | aPos, aErr := findKeyStart(raw, key) |
| 625 | bPos, bErr := findKeyStart(raw, key) |
| 626 | if aPos != bPos || (aErr == nil) != (bErr == nil) { |
| 627 | t.Fatalf("findKeyStart non-deterministic on input %q key=%q: (%d,%v) vs (%d,%v)", raw, key, aPos, aErr, bPos, bErr) |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | // --------------------------------------------------------------------------- |
| 633 | // Property: token-boundary helpers are deterministic and never panic |
nothing calls this directly
no test coverage detected