T52: a press wakes Ely from her doze, which the owner asked for after 0.1.4, where only a new mood woke her: calm lasts 5 minutes from her mood's start or the last press before she dozes, so after a press she stays awake 5 minutes, then dozes again
CI / platforms (ubuntu-24.04) (push) Successful in 1m29s
CI / platforms (windows-latest) (push) Successful in 1m31s
CI / macos (push) Canceled after 0s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 02:35:13 -04:00
1 parent dbb19caaf8
commit 0eb8fc5c4e
7 files changed
+40 -7

No files matched your search

+17
View File
@@ -169,6 +169,23 @@ fn a_press_winks_with_a_heart_that_rises() {
assert!(asleep.open[1] > 0.9, "a press wakes her other eye");
}
#[test]
fn a_press_wakes_her_from_her_doze_for_five_minutes_more() {
assert_eq!(at(Mood::Calm, 400.0).act, Act::Doze, "asleep, unpressed");
let pressed = |since: f64| pose(Mood::Calm, 400.0 + since, 410.0 + since, Some(since));
assert_eq!(pressed(0.5).act, Act::Wink);
assert_eq!(
(pressed(2.0).act, pressed(2.0).eyes),
(Act::Calm, Eyes::Open),
"awake after the wink"
);
assert_eq!(pressed(299.0).act, Act::Calm, "awake five minutes");
assert_eq!(pressed(301.0).act, Act::Doze, "then asleep again");
assert!(pressed(300.3).open[0] < 1.0, "her eyes fall shut again");
let finished = pose(Mood::Done, 400.0, 410.0, Some(2.0));
assert_eq!(finished.act, Act::Calm, "a finish long past wakes alike");
}
#[test]
fn she_rises_from_behind_the_edge_when_she_comes() {
assert!(pose(Mood::Calm, 0.0, 0.0, None).lift <= -DEPTH);