From cffaa8f3e33f21f0e26a22637eb4167954c4c420 Mon Sep 17 00:00:00 2001 From: RobinFiredrake Date: Tue, 1 Dec 2026 14:17:40 -0600 Subject: [PATCH] Tests: old deck and Earlier tests follow the new behaviour Co-Authored-By: Claude Opus 5.5 --- tests/test_logic_ui.gd | 2 +- tests/test_model.gd | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_logic_ui.gd b/tests/test_logic_ui.gd index 97b8a8c..6824a7a 100644 --- a/tests/test_logic_ui.gd +++ b/tests/test_logic_ui.gd @@ -248,7 +248,7 @@ func _test_replace() -> void: _check(second != null and second != first, "the new roll opens its own pop-up") _check(not is_instance_valid(first) or first.is_queued_for_deletion(), "the old pop-up goes away") _check(not main.current.has("halted"), "the old roll doesn't overwrite the new one") - _eq(main.history.size(), history, "the replaced (unanswered) roll isn't added to Earlier") + _eq(main.history.size(), history + 1, "the replaced (unanswered) roll moves to Earlier (Robin, 2026-12-01)") if second == null: return second._text.text = "Cy" diff --git a/tests/test_model.gd b/tests/test_model.gd index a4a6a3a..584e3b7 100644 --- a/tests/test_model.gd +++ b/tests/test_model.gd @@ -217,8 +217,9 @@ func _test_cards() -> void: # Edits. t.deck_empty = "reshuffle" var d3 := DeckState.new() - for i in 4: - d3.draw(t, r) + for entry in t.entries: + for copy in d3.copies_of(t, entry): + d3.take(entry) _check(d3.cards_left(t) == Vector2i(0, 4), "fully drawn deck") t.entries[0].weight = 3 _check(d3.cards_left(t) == Vector2i(2, 6), "raising a weight adds copies") @@ -226,8 +227,8 @@ func _test_cards() -> void: _check(d3.cards_left(t) == Vector2i(3, 7), "new entries start undrawn") t.entries.remove_at(1) _check(d3.cards_left(t) == Vector2i(3, 5), "deleted entries drop out") - var first := d3.draw(t, r) - _check(first.has("index"), "can still draw after edits") + d3.take(t.entries[0]) + _check(d3.cards_left(t) == Vector2i(2, 5), "can still draw after edits") t.entries[0].weight = 1 _check(d3.cards_left(t).x == 1 and d3.cards_left(t).y == 3, "lowering a weight removes copies (%s)" % str(d3.cards_left(t)))