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) + } +}