feat: add drop key functionality #6

Merged
mvhutz merged 12 commits from feat/drop-item into main 2026-03-20 01:59:55 +00:00
Owner

Currently, the Table.Drop() function is deprecated because it is not implemented yet. Let's add that functionality.

  • Adds true drop functionality to the table, through Table.Drop().
  • Adds tests for functionality.
  • Rewrites fuzz test using go_fuzz_utils, to test arbitrary usage patterns.
  • Rewrite bucket to allow a capacity of zero.
  • Rename Table.Capacity() to Table.TotalCapacity(), to reflect to different between the capacity of the buckets vs. the whole table.
  • Enforce 100% mutation test coverage.
Currently, the `Table.Drop()` function is deprecated because it is not implemented yet. Let's add that functionality. - Adds true drop functionality to the table, through `Table.Drop()`. - Adds tests for functionality. - Rewrites fuzz test using `go_fuzz_utils`, to test arbitrary usage patterns. - Rewrite `bucket` to allow a capacity of zero. - Rename `Table.Capacity()` to `Table.TotalCapacity()`, to reflect to different between the capacity of the buckets vs. the whole table. - Enforce 100% mutation test coverage.
mvhutz added 7 commits 2026-03-20 00:57:02 +00:00
- Added `drop()` function in buckets.
- Implemented `Drop()` function for Table.
- Generalized Table.resize() to accept a capacity size for each bucket.
- Added guards at the bucket level, to ensure that getting an item in an empty bucket doesn't cause an error.
- Added grow() and shrink() functions to Table, to prevent a capacity of 0 from not being able to grow.
- Updated the fuzz test to use `go_fuzz-utils`.
chore: removed testdata for fuzz test
Some checks failed
CI / Go Lint (pull_request) Failing after 11s
CI / Makefile Lint (pull_request) Successful in 41s
CI / Unit Tests (pull_request) Successful in 45s
CI / Fuzz Tests (pull_request) Successful in 1m25s
CI / Mutation Tests (pull_request) Successful in 1m17s
bd3f0aad04
mvhutz added 1 commit 2026-03-20 01:06:37 +00:00
docs: added comments to give context to functions
Some checks failed
CI / Makefile Lint (pull_request) Successful in 21s
CI / Go Lint (pull_request) Failing after 12s
CI / Unit Tests (pull_request) Successful in 14s
CI / Fuzz Tests (pull_request) Successful in 1m14s
CI / Mutation Tests (pull_request) Successful in 53s
0c81bc5cae
mvhutz added 1 commit 2026-03-20 01:08:40 +00:00
chore: go mod tidy
All checks were successful
CI / Go Lint (pull_request) Successful in 49s
CI / Makefile Lint (pull_request) Successful in 38s
CI / Unit Tests (pull_request) Successful in 14s
CI / Fuzz Tests (pull_request) Successful in 1m10s
CI / Mutation Tests (pull_request) Successful in 58s
f636ce8911
mvhutz changed title from WIP: feat: add drop key functionality to feat: add drop key functionality 2026-03-20 01:08:54 +00:00
mvhutz added 1 commit 2026-03-20 01:20:53 +00:00
ci: enforce 100% mutation coverage
Some checks failed
CI / Makefile Lint (pull_request) Successful in 20s
CI / Go Lint (pull_request) Successful in 17s
CI / Unit Tests (pull_request) Successful in 14s
CI / Mutation Tests (pull_request) Failing after 13s
CI / Fuzz Tests (pull_request) Successful in 1m13s
afd3472d1d
This will strongly indicate whether the test cases actually cover.
mvhutz added 1 commit 2026-03-20 01:23:41 +00:00
fix: mutation test threshold should be in config
Some checks failed
CI / Makefile Lint (pull_request) Successful in 16s
CI / Go Lint (pull_request) Successful in 20s
CI / Unit Tests (pull_request) Successful in 15s
CI / Fuzz Tests (pull_request) Successful in 47s
CI / Mutation Tests (pull_request) Failing after 40s
cd115ba7a2
There isn't a `--threshold` flag for `go-gremlins`.
mvhutz added 1 commit 2026-03-20 01:57:55 +00:00
feat: 100% mutation test coverage
All checks were successful
CI / Go Lint (pull_request) Successful in 19s
CI / Makefile Lint (pull_request) Successful in 18s
CI / Unit Tests (pull_request) Successful in 16s
CI / Fuzz Tests (pull_request) Successful in 48s
CI / Mutation Tests (pull_request) Successful in 45s
09b5d9d893
- Fixed mutation coverage to be 1.0, instead of 100.
mvhutz merged commit 56b1982f8a into main 2026-03-20 01:59:55 +00:00
mvhutz deleted branch feat/drop-item 2026-03-20 01:59:55 +00:00
Sign in to join this conversation.