aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/pai_gow_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-05 17:05:14 -0400
committerhistoria <[not public]>2026-10-05 17:05:14 -0400
commite42952469dadfb3535633c66c881050ac128703c (patch)
treea78f7396b72cdbd6fa4f6c454c830f40cf2ad0cb /internal/casino/pai_gow_test.go
parent90ad8c0c33b519d5830c69d4128bdc984b5e9de8 (diff)
downloadthehouseoficarus-e42952469dadfb3535633c66c881050ac128703c.tar.gz
fix: gather verbs, walk oom, admin path bypass, roulette refund
Diffstat (limited to 'internal/casino/pai_gow_test.go')
-rw-r--r--internal/casino/pai_gow_test.go28
1 files changed, 28 insertions, 0 deletions
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")
+ }
+}