From fea2cc6839ec3ee17940a2dea69622dc6f4deabf Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 16 Sep 2026 21:35:55 -0400 Subject: fix: unify crafting ingredient resolution; fix superheat alternatives, quantity gates, and dropped combine byproducts --- internal/casino/blackjack_split_regression_test.go | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 internal/casino/blackjack_split_regression_test.go (limited to 'internal/casino/blackjack_split_regression_test.go') diff --git a/internal/casino/blackjack_split_regression_test.go b/internal/casino/blackjack_split_regression_test.go new file mode 100644 index 0000000..1674d40 --- /dev/null +++ b/internal/casino/blackjack_split_regression_test.go @@ -0,0 +1,36 @@ +package casino + +// Regression: a non-ace split can draw to 21 on the first hand (K,K splits +// into A+K). finishHand must skip that complete hand instead of prompting it, +// which offered hit/double on an unplayable 21 and stalled the round until +// the action timer fired. + +import "testing" + +func TestBlackjackSplitTwentyOneAdvancesToNextHand(t *testing.T) { + table := newBlackjackTable(1, TableConfig{ID: "blackjack", Game: GameBlackjack}, newTestRand()) + wallet := &testWallet{credits: 100} + table.join("alice") + // Dealer 17; player K,K; the split draws A (hand one) and 5 (hand two). + table.shoe = tableauShoe( + card{rank: "10"}, card{rank: "7"}, + card{rank: "K"}, card{rank: "K"}, + card{rank: "A"}, card{rank: "5"}, card{rank: "2"}, + ) + table.shoe.shuffleAt = 0 + table.bet("alice", "", 10, wallet) + if events := table.action("alice", "split"); len(events) == 0 { + t.Fatal("split produced no events") + } + p := table.players.get("alice") + if len(p.hands) != 2 { + t.Fatalf("split failed: %+v", p.hands) + } + if total, _ := p.hands[0].total(); total != 21 { + t.Fatalf("fixture: first split hand totals %d, want 21", total) + } + if table.activeHand != 1 { + t.Fatalf("split 21 stayed active (hand %d, actions %v); the turn must advance to the second hand", + table.activeHand, table.availableActions(p, p.hands[table.activeHand])) + } +} -- cgit v1.2.3