Skip to content

fix: reset cost to zero on DeleteAll - #222

Merged
swithek merged 2 commits into
jellydator:v3from
MFactor1:fix-delete-all
Sep 14, 2026
Merged

swithek merged 2 commits into
jellydator:v3from
MFactor1:fix-delete-all

Conversation

@MFactor1

@MFactor1 MFactor1 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Closes #221.

When run with the reproduction shown in #221, it results in the correct output:

Cache starting size: 0
Inserting: key1
Inserting: key2
Inserting: key3
Cache size after insertion: 3
Evicting: key3
Evicting: key1
Evicting: key2
Cache size after deletion: 0
Inserting: key4
Cache size after inserting again: 1

@swithek swithek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. If you can, update the tests and I'll merge this.

Comment thread cache_test.go Outdated
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 34653981857

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.002%) to 99.743%

Details

  • Coverage increased (+0.002%) from the base build.
  • Patch coverage: 4 of 4 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 777
Covered Lines: 775
Line Coverage: 99.74%
Coverage Strength: 25.63 hits per line

💛 - Coveralls

@swithek swithek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, thanks for the changes 🫡

@swithek
swithek merged commit f83d1c3 into jellydator:v3 Sep 14, 2026
2 checks passed
@MFactor1
MFactor1 deleted the fix-delete-all branch September 16, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeleteAll() doesn't update cost tracking

3 participants