diff options
Diffstat (limited to 'internal/casino/table_ux_test.go')
| -rw-r--r-- | internal/casino/table_ux_test.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/casino/table_ux_test.go b/internal/casino/table_ux_test.go index cb13300..ea8bc04 100644 --- a/internal/casino/table_ux_test.go +++ b/internal/casino/table_ux_test.go @@ -57,14 +57,24 @@ func TestBlackjackWarnsOnceThenAutoStands(t *testing.T) { } } } - if warnings != 1 || !timeout { - t.Fatalf("multi=%v warnings=%d timeout=%v", multi, warnings, timeout) + if multi { + if warnings != 1 || !timeout { + t.Fatalf("multi warnings=%d timeout=%v", warnings, timeout) + } + continue + } + // A lone player has no timer: no warning, no forced stand. + if warnings != 0 || timeout || table.phase != blackjackPlaying { + t.Fatalf("solo warnings=%d timeout=%v phase=%s", warnings, timeout, table.phase) } } } func TestInsuranceRequiresExplicitDecisionAndWarns(t *testing.T) { table := uxBlackjack() + // A second seated player keeps the multi-player insurance timer running; + // they have already declined so only alice is still deciding. + table.players.add("bob", &blackjackPlayer{Participant: Participant{Name: "bob", Connected: true, HasBet: true, Wager: Wager{Total: 10}}, declinedInsurance: true}) table.phase = blackjackInsurance table.timer.start(8) before := len(table.players.get("alice").hands[0].cards) |
