Files
anki/rslib
Fernando Lins d8ce60c272 test: add service-layer unit tests for scheduler and cards (#4924) (#5042)
## 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.
2026-06-23 11:07:29 -03:00
..
2025-09-01 14:55:49 +10:00
2026-05-05 17:29:18 -04:00
2025-06-27 16:10:12 +07:00
2020-11-01 14:26:58 +10:00
2023-07-01 18:26:43 +10:00
2023-07-02 18:22:44 +10:00
2022-11-27 15:24:20 +10:00
2025-06-29 11:50:49 +07:00

Anki's Rust code.