From c669ac145324719cc9a32e12c4fc8d6ab45e8066 Mon Sep 17 00:00:00 2001 From: Greyson Parrelli Date: Thu, 23 Jul 2026 08:49:37 -0400 Subject: [PATCH] Test that Skunk's strip faints a pet dropped below its damage. --- internal/game/battle_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/internal/game/battle_test.go b/internal/game/battle_test.go index e7e7f76..0179f1b 100644 --- a/internal/game/battle_test.go +++ b/internal/game/battle_test.go @@ -714,3 +714,25 @@ func TestBattleResultExposesLineups(t *testing.T) { t.Fatalf("seat 1 lineup should mirror its arranged deck: %+v", res.Lineups[1]) } } + +// A Skunk that strips a buffed pet's apples must drop that pet below its +// damage markers so it faints on the spot, rather than lingering at what is +// effectively negative health. +func TestSkunkStripFaintsDebuffedPet(t *testing.T) { + g, _, _ := testGame(t) + // Seat 1 fields a 3-power pet wearing three apples (effectively 6 power). + buffed := []Card{g.newApple(), g.newApple(), g.newApple(), g.pet("Buffed", 3)} + // Seat 0's Ram (4 power) trades in first: Ram dies, Buffed survives with 4 + // damage (still under its buffed 6 power). Then the Skunk strips the + // apples, dropping Buffed to 3 power < 4 damage — it must faint at once. + mine := []Card{g.pet("Ram", 4), g.realPet(t, "Skunk")} + res := forceBattle(t, g, mine, buffed) + + strips := eventsOfType(res, "strip") + if len(strips) != 1 || !strips[0].TargetDied { + t.Fatalf("skunk strip should faint the de-buffed pet: %+v", strips) + } + if res.WinnerSeat != 0 { + t.Fatalf("skunk should win once the stripped pet faints, got %d", res.WinnerSeat) + } +}