Skip to content

Add unit tests for src/cache.rs #26

Description

@ih8js-git

Why it needs tests: The Id struct has parsing logic (Id::new), and CacheStore has key generation logic (build_key). It also manages serialization and file persistence.

How to test it:

  • Id and build_key can be tested purely.
  • The CacheStore methods (get, set, remove) can be unit tested, but you would likely want to make a small refactor to allow passing a custom temporary path for the database during tests so it doesn't overwrite your actual cache or depend on the OS directory during cargo test.

Metadata

Metadata

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions