test: add BDD (godog) suite and fuzz targets
Summary
Add a Godog BDD suite covering every public method and every concurrency scenario the library guarantees, plus go test -fuzz targets for Load/Store round-trips and random concurrent operations. Re-enables the bdd-strict-mode-guard CI job that was deferred in #8.
Requirements
tests/bdd/ tree:
tests/bdd/features/syncmap.feature — Gherkin scenarios covering: Load (present / missing / zero V), Store (new / overwrite), LoadOrStore (absent / present / contention), LoadAndDelete (present / missing / zero V), Delete (present / missing / idempotent), Range (all / early return / concurrent writes), Len (after store / after delete), Map (snapshot independence), Keys (match / empty), Values (match / empty), Swap (absent / present / concurrent), Clear (empty / populated), CompareAndSwap (match / mismatch / missing / contention), CompareAndDelete (match / mismatch / missing).
tests/bdd/steps/syncmap_steps.go — step definitions; thin wrappers that translate Gherkin to SyncMap calls.
tests/bdd/suite_test.go — godog TestSuite{} entry with Strict: true explicitly set (satisfies bdd-strict-mode-guard).
- All files carry Apache 2.0 header; build tag
//go:build bdd.
- Fuzz targets in a new
syncmap_fuzz_test.go (package syncmap_test, Apache header):
FuzzLoadStore — random byte keys + values, verify Load returns what was Stored.
FuzzConcurrent — random interleaved Store/Delete/Load operations across multiple goroutines; asserts no panic under -race.
makefile-targets-guard stays satisfied; make test-bdd is already in place.
- CI: re-enable
bdd-strict-mode-guard job in ci.yml (ported verbatim from mask, now that tests/bdd/ exists).
- No
@wip / @skip / @pending / @todo tags anywhere in feature files (enforced by bdd-strict-mode-guard).
godog and goleak dependencies added to go.mod if not already present. Both are test-only.
Acceptance Criteria
tests/bdd/features/syncmap.feature exists with ≥1 Scenario per public symbol.
tests/bdd/steps/syncmap_steps.go exists and registers step definitions for every phrase used in the feature file.
tests/bdd/suite_test.go contains exactly one godog.TestSuite{…} construction with Strict: true on a line by itself (grep-able).
make test-bdd exits 0, runs every scenario, reports zero failures and zero undefined/pending/skipped steps.
go test -fuzz=FuzzLoadStore -fuzztime=30s ./... runs without panics.
go test -fuzz=FuzzConcurrent -fuzztime=30s ./... runs without panics under -race.
bdd-strict-mode-guard job in ci.yml is enabled and passes on this PR.
make check passes; CI on the PR green.
- Every new
.go file carries the Apache 2.0 header.
- No AI-attribution tokens in any new file.
Testing Requirements
make test-bdd green.
go test -fuzz short runs (CI runs with explicit -fuzztime) green.
- CI
bdd-strict-mode-guard green.
make check green.
Documentation Requirements
Dependencies
Labels
test: add BDD (godog) suite and fuzz targets
Summary
Add a Godog BDD suite covering every public method and every concurrency scenario the library guarantees, plus
go test -fuzztargets for Load/Store round-trips and random concurrent operations. Re-enables thebdd-strict-mode-guardCI job that was deferred in #8.Requirements
tests/bdd/tree:tests/bdd/features/syncmap.feature— Gherkin scenarios covering: Load (present / missing / zero V), Store (new / overwrite), LoadOrStore (absent / present / contention), LoadAndDelete (present / missing / zero V), Delete (present / missing / idempotent), Range (all / early return / concurrent writes), Len (after store / after delete), Map (snapshot independence), Keys (match / empty), Values (match / empty), Swap (absent / present / concurrent), Clear (empty / populated), CompareAndSwap (match / mismatch / missing / contention), CompareAndDelete (match / mismatch / missing).tests/bdd/steps/syncmap_steps.go— step definitions; thin wrappers that translate Gherkin to SyncMap calls.tests/bdd/suite_test.go— godogTestSuite{}entry withStrict: trueexplicitly set (satisfiesbdd-strict-mode-guard).//go:build bdd.syncmap_fuzz_test.go(package syncmap_test, Apache header):FuzzLoadStore— random byte keys + values, verifyLoadreturns what wasStored.FuzzConcurrent— random interleaved Store/Delete/Load operations across multiple goroutines; asserts no panic under-race.makefile-targets-guardstays satisfied;make test-bddis already in place.bdd-strict-mode-guardjob inci.yml(ported verbatim from mask, now thattests/bdd/exists).@wip/@skip/@pending/@todotags anywhere in feature files (enforced bybdd-strict-mode-guard).godogandgoleakdependencies added togo.modif not already present. Both are test-only.Acceptance Criteria
tests/bdd/features/syncmap.featureexists with ≥1 Scenario per public symbol.tests/bdd/steps/syncmap_steps.goexists and registers step definitions for every phrase used in the feature file.tests/bdd/suite_test.gocontains exactly onegodog.TestSuite{…}construction withStrict: trueon a line by itself (grep-able).make test-bddexits 0, runs every scenario, reports zero failures and zero undefined/pending/skipped steps.go test -fuzz=FuzzLoadStore -fuzztime=30s ./...runs without panics.go test -fuzz=FuzzConcurrent -fuzztime=30s ./...runs without panics under-race.bdd-strict-mode-guardjob inci.ymlis enabled and passes on this PR.make checkpasses; CI on the PR green..gofile carries the Apache 2.0 header.Testing Requirements
make test-bddgreen.go test -fuzzshort runs (CI runs with explicit-fuzztime) green.bdd-strict-mode-guardgreen.make checkgreen.Documentation Requirements
Dependencies
Labels
testingP1