Skip to content

test: tighten TestRangeDuringWrites to assert no-duplicate-visits #48

@millerjp

Description

@millerjp

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

  1. Assertion added; test stable over -count=10.
  2. A broken Range implementation that re-visits would cause the test to fail.

Source: test-analyst.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important, not blockingtestingTests: unit, BDD, benchmarks, fuzz

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions