aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/hardening_fixes_batch2_test.go
diff options
context:
space:
mode:
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)
}
}