--------------------------------------------------------------------------- Property: findKeyStart is deterministic on arbitrary bytes --------------------------------------------------------------------------- reqproof:proptest findKeyStart Verifies: SYS-REQ-001 [property]
(t *testing.T)
| 503 | // reqproof:proptest findKeyStart |
| 504 | // Verifies: SYS-REQ-001 [property] |
| 505 | func TestPropertyFindKeyStartDeterminism(t *testing.T) { |
| 506 | r := newRNG(jsonSeed + 8) |
| 507 | const iterations = 2000 |
| 508 | for i := 0; i < iterations; i++ { |
| 509 | raw := randomBytes(r, 64) |
| 510 | key := randKey(r) |
| 511 | aPos, aErr := findKeyStart(raw, key) |
| 512 | bPos, bErr := findKeyStart(raw, key) |
| 513 | if aPos != bPos || (aErr == nil) != (bErr == nil) { |
| 514 | t.Fatalf("findKeyStart non-deterministic on input %q key=%q: (%d,%v) vs (%d,%v)", raw, key, aPos, aErr, bPos, bErr) |
| 515 | } |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | // --------------------------------------------------------------------------- |
| 520 | // Property: token-boundary helpers are deterministic and never panic |
nothing calls this directly
no test coverage detected