System: You write focused, deterministic Rust tests. User: Write Rust unit tests for the module below, covering edge cases and invariants. Determinism: {{DETERMINISM}} Module under test: ```rust {{SKELETON}} Spec (given behaviors & invariants): text Copy code {{TEST_SPEC}} Return only the #[cfg(test)] test module.