From e42952469dadfb3535633c66c881050ac128703c Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 5 Oct 2026 17:05:14 -0400 Subject: fix: gather verbs, walk oom, admin path bypass, roulette refund --- internal/casino/pai_gow_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'internal/casino/pai_gow_test.go') diff --git a/internal/casino/pai_gow_test.go b/internal/casino/pai_gow_test.go index 7be9e8a..100b87d 100644 --- a/internal/casino/pai_gow_test.go +++ b/internal/casino/pai_gow_test.go @@ -838,3 +838,31 @@ func TestPaiGowBettingWindowTimeoutNotifiesNonBettor(t *testing.T) { t.Fatal("non-bettor was not told the betting window closed") } } + +// Regression: with one bettor and one idle seated player the betting window +// must still close. activePlayersLocked counts bettors, so it used to stay at 1 +// forever and the round stalled until the idle seat bet or left. +func TestPaiGowBettingWindowExpiresWithOneBettorAndIdleSeat(t *testing.T) { + tab := pgTestTable(false) // BettingTicks 2 + w := &testWallet{chips: 100} + tab.join("a") + tab.join("b") + tab.bet("a", "main", 10, w) + if tab.phase != "betting" { + t.Fatalf("setup: wanted betting, got %s", tab.phase) + } + notified := false + for i := 0; i < 4; i++ { + for _, e := range tab.tick() { + if e.PrivateTo == "b" && strings.Contains(e.Message, "betting window closed") { + notified = true + } + } + } + if tab.phase == "betting" { + t.Fatal("round stalled in betting with one bettor and one idle seat") + } + if !notified { + t.Fatal("idle seat was not sat out when the window closed") + } +} -- cgit v1.2.3