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

1 commit

Author SHA1 Message Date
6ef266e76a
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
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.
2026-07-08 23:32:59 +02:00