diff options
| author | historia <[not public]> | 2026-10-10 04:08:09 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-10 04:08:09 -0400 |
| commit | 9fb1f9010526100e12dd1ab1b0ca98401bb6ed75 (patch) | |
| tree | 4a128211bfb0dd429bbb559a591d6c4be25c7757 /internal/casino/roulette_test.go | |
| parent | ced77d7c89129da6ba4001ab8e3dad265aa41396 (diff) | |
| download | thehouseoficarus-9fb1f9010526100e12dd1ab1b0ca98401bb6ed75.tar.gz | |
Diffstat (limited to 'internal/casino/roulette_test.go')
| -rw-r--r-- | internal/casino/roulette_test.go | 12 |
1 files changed, 9 insertions, 3 deletions
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") } } |
