aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/roulette_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/casino/roulette_test.go')
-rw-r--r--internal/casino/roulette_test.go12
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")
}
}