From 9fb1f9010526100e12dd1ab1b0ca98401bb6ed75 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 10 Oct 2026 04:08:09 -0400 Subject: feat: add casino game: crazy time --- internal/casino/roulette_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'internal/casino/roulette_test.go') diff --git a/internal/casino/roulette_test.go b/internal/casino/roulette_test.go index a0e04d4..3425f94 100644 --- a/internal/casino/roulette_test.go +++ b/internal/casino/roulette_test.go @@ -281,9 +281,15 @@ func TestRouletteTimedPhasesAndSettlement(t *testing.T) { w := &testWallet{chips: 100} table.bet("a", wheel[index], 10, w) table.bet("a", "red", 10, w) - if w.chips != 90 || table.phase != phaseBetting { + if w.chips != 80 || table.phase != phaseBetting { t.Fatal("duplicate or early spin") } + // Both wagers are on the table: the straight-up wins its 36x total + // return, and the red wager adds 20 when the winning pocket is red. + wantPaid := 360 + if n, err := strconv.Atoi(wheel[index]); err == nil && rouletteRed(n) { + wantPaid += 20 + } table.tick() if table.phase != phaseBetting { t.Fatal("betting ended early") @@ -304,7 +310,7 @@ func TestRouletteTimedPhasesAndSettlement(t *testing.T) { } table.action("a", "leave_after") events = table.tick() - if w.paid != 360 || len(w.open) != 0 || table.hasParticipant("a") { + if w.paid != wantPaid || len(w.open) != 0 || table.hasParticipant("a") { t.Fatalf("bad settlement: %+v", w) } s := events[0].Snapshot.(*RouletteSnapshot) @@ -318,7 +324,7 @@ func TestRouletteTimedPhasesAndSettlement(t *testing.T) { } table.tick() table.refundAll() - if w.paid != 360 { + if w.paid != wantPaid { t.Fatal("double paid") } } -- cgit v1.2.3