Tests: old deck and Earlier tests follow the new behaviour

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
RobinFiredrake 2026-12-01 14:17:40 -06:00
parent 9b68da43d8
commit cffaa8f3e3
2 changed files with 6 additions and 5 deletions

View file

@ -248,7 +248,7 @@ func _test_replace() -> void:
_check(second != null and second != first, "the new roll opens its own pop-up") _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 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") _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: if second == null:
return return
second._text.text = "Cy" second._text.text = "Cy"

View file

@ -217,8 +217,9 @@ func _test_cards() -> void:
# Edits. # Edits.
t.deck_empty = "reshuffle" t.deck_empty = "reshuffle"
var d3 := DeckState.new() var d3 := DeckState.new()
for i in 4: for entry in t.entries:
d3.draw(t, r) for copy in d3.copies_of(t, entry):
d3.take(entry)
_check(d3.cards_left(t) == Vector2i(0, 4), "fully drawn deck") _check(d3.cards_left(t) == Vector2i(0, 4), "fully drawn deck")
t.entries[0].weight = 3 t.entries[0].weight = 3
_check(d3.cards_left(t) == Vector2i(2, 6), "raising a weight adds copies") _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") _check(d3.cards_left(t) == Vector2i(3, 7), "new entries start undrawn")
t.entries.remove_at(1) t.entries.remove_at(1)
_check(d3.cards_left(t) == Vector2i(3, 5), "deleted entries drop out") _check(d3.cards_left(t) == Vector2i(3, 5), "deleted entries drop out")
var first := d3.draw(t, r) d3.take(t.entries[0])
_check(first.has("index"), "can still draw after edits") _check(d3.cards_left(t) == Vector2i(2, 5), "can still draw after edits")
t.entries[0].weight = 1 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))) _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)))