chore: Add more tests for Cache, fix edge case in Cache::get(server_name) #29

Merged
ginger merged 1 commit from zoe/additional-tests into main 2026-07-09 16:47:25 +00:00
Member

More tests added to reach 100% line coverage when running tests with coverage. Also adds some more doc comments on methods.

The edgecase fix is that .get() would previously remove a cached entry if it was expired, without removing the associated hostname mapping. This could possibly result in a CacheLookup::ExpiredOverride being returned when there is no cache entry at all, and the correct return value is CacheLookup::Miss.

The fix here is to also remove the hostname mapping, correctly making CacheLookup::Miss be returned.

More tests added to reach 100% line coverage when running tests with coverage. Also adds some more doc comments on methods. The edgecase fix is that `.get()` would previously remove a cached entry if it was expired, without removing the associated hostname mapping. This could possibly result in a `CacheLookup::ExpiredOverride` being returned when there is no cache entry at all, and the correct return value is `CacheLookup::Miss`. The fix here is to also remove the hostname mapping, correctly making `CacheLookup::Miss` be returned.
chore: Add more tests for Cache, fix edge case in Cache::get(server_name)
All checks were successful
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 42s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 1m51s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m48s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 2m24s
6ef266e76a
More tests added to reach 100% line coverage when running tests with
coverage. Also adds some more doc comments on methods.

The edgecase fix is that `.get()` would previously remove a cached
entry if it was expired, without removing the associated hostname
mapping. This could possibly result in a `CacheLookup::ExpiredOverride`
being returned when there is no cache entry at all, and the correct
return value is `CacheLookup::Miss`.

The fix here is to also remove the hostname mapping, correctly making
`CacheLookup::Miss` be returned.
s1lv3r scheduled this pull request to auto merge when all checks succeed 2026-07-09 11:03:46 +00:00
ginger merged commit 6ef266e76a into main 2026-07-09 16:47:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/resolvematrix!29
No description provided.