Summary
TestRangeDuringWrites asserts only that observed keys lie in [0, keyCount). It does not assert the stdlib sync.Map.Range contract guarantee "no key will be visited more than once".
Scope
Track visited keys in a map[int]struct{} (scenario-local, not concurrent) after Range completes and assert every key appears at most once.
Acceptance criteria
- Assertion added; test stable over
-count=10.
- A broken Range implementation that re-visits would cause the test to fail.
Source: test-analyst.
Summary
TestRangeDuringWritesasserts only that observed keys lie in[0, keyCount). It does not assert the stdlibsync.Map.Rangecontract guarantee "no key will be visited more than once".Scope
Track visited keys in a
map[int]struct{}(scenario-local, not concurrent) afterRangecompletes and assert every key appears at most once.Acceptance criteria
-count=10.Source: test-analyst.