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

+15
View File
@@ -73,6 +73,21 @@ fn a_change_of_mood_or_a_press_eases_her_from_where_she_is_though_the_act_stays(
);
}
#[test]
fn a_press_on_her_while_she_dozes_wakes_her() {
let start = Instant::now();
let at = |secs: u64| start + Duration::from_secs(secs);
let mut pet = ely(Mood::Calm, start);
assert_eq!(pet.pose(at(400)).act, Act::Doze);
pet.press(at(400));
assert_eq!(pet.pose(at(402)).act, Act::Calm, "awake");
assert_eq!(
pet.pose(at(701)).act,
Act::Doze,
"five calm minutes on, asleep again"
);
}
#[test]
fn she_stands_on_the_top_edge_while_her_box_fits_above_it() {
assert_eq!(edge(HEAD + ROOM), Edge::Top, "just room for her");