aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/hardening_fixes_batch2_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 19:30:38 -0400
committerhistoria <[not public]>2026-10-01 19:30:38 -0400
commit6d9908b29c8187196d23b126b1165c7e0bd0fc76 (patch)
treeddbc02357ed92646b801687b90b1a06c71a15d71 /internal/casino/hardening_fixes_batch2_test.go
parent8a94f21bd47c0a00bc415395232dba22fa958837 (diff)
downloadthehouseoficarus-6d9908b29c8187196d23b126b1165c7e0bd0fc76.tar.gz
fix: casino pai gow sorting, universal unbet, table/rules split, remove solo timers
Diffstat (limited to 'internal/casino/hardening_fixes_batch2_test.go')
-rw-r--r--internal/casino/hardening_fixes_batch2_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/internal/casino/hardening_fixes_batch2_test.go b/internal/casino/hardening_fixes_batch2_test.go
index 1391143..54c7def 100644
--- a/internal/casino/hardening_fixes_batch2_test.go
+++ b/internal/casino/hardening_fixes_batch2_test.go
@@ -70,10 +70,10 @@ func TestSlotProfileRejectsWeightlessTrigger(t *testing.T) {
}
}
-// TestDisconnectingNonBettorDoesNotResetLoneTurnCeiling: a third party's
-// seat event re-prompts the same turn and must not extend a hung lone
-// bettor's absolute deadline.
-func TestDisconnectingNonBettorDoesNotResetLoneTurnCeiling(t *testing.T) {
+// TestNonBettorDoesNotStartLoneBettorTimer: a spectator at the table must
+// not put a lone bettor on the clock. With only one live wager the action
+// timer and turn ceiling both stay stopped, so the hand waits for the player.
+func TestNonBettorDoesNotStartLoneBettorTimer(t *testing.T) {
table := newBlackjackTable(1, TableConfig{ID: "blackjack", Game: GameBlackjack, MaxPlayers: 3,
Blackjack: BlackjackConfig{ActionTicks: 2}}, newTestRand())
table.shoe = tableauShoe(
@@ -96,13 +96,12 @@ func TestDisconnectingNonBettorDoesNotResetLoneTurnCeiling(t *testing.T) {
for i := 0; i < 3; i++ {
table.tick()
}
- before := table.ceiling.clock
- if before == 0 {
- t.Fatal("setup: turn ceiling did not advance")
+ if table.ceiling.clock != 0 || table.timer.clock != 0 {
+ t.Fatalf("a spectator started a timer for a lone bettor: ceiling=%d timer=%d", table.ceiling.clock, table.timer.clock)
}
table.markDisconnected("bob")
- if table.ceiling.clock != before {
- t.Fatalf("a non-bettor's disconnect reset the turn ceiling: %d -> %d", before, table.ceiling.clock)
+ if table.phase != blackjackPlaying || table.ceiling.clock != 0 || table.timer.clock != 0 {
+ t.Fatalf("non-bettor disconnect changed the lone bettor's timers: phase=%s ceiling=%d timer=%d", table.phase, table.ceiling.clock, table.timer.clock)
}
}