mirror of
https://github.com/ankitects/anki.git
synced 2026-07-22 02:06:48 -04:00
## Linked issue Fixes #4924 ## Summary/motivation The scheduler/cards service layer that the front-end and gRPC clients call into was largely untested. This PR adds unit tests that exercise each method through the `SchedulerService` / `CardsService` traits (proto-in / proto-out), mirroring how users actually use them, and asserts the resulting state in `Collection` storage. **Out of scope**: pure FSRS math methods are intentionally left out. ## How to test ### Details - `cargo test -p anki --lib scheduler::service::tests` — 42 passing. - `cargo test -p anki --lib card::service::tests` — 1 passing. - `cargo fmt --check` and lints clean. - Tests are deterministic and isolated (each builds its own in-memory `Collection`); the randomize test uses a retry loop with a permutation invariant instead of a probabilistic assertion.
Anki's Rust code.