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.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/casino/roulette_test.go b/internal/casino/roulette_test.go
index 97bff2a..a0e04d4 100644
--- a/internal/casino/roulette_test.go
+++ b/internal/casino/roulette_test.go
@@ -356,7 +356,13 @@ func TestRouletteRefundAndPersistenceFailure(t *testing.T) {
table.markDisconnected("a")
table.refundAll()
table.tick()
- if w.chips != 100 || len(w.open) != 0 || w.paid != 0 {
+ if spinning {
+ // Once the spin starts the winning pocket is fixed; disconnecting
+ // forfeits the stake instead of allowing a selective refund.
+ if w.chips != 90 || len(w.open) != 0 || w.paid != 0 {
+ t.Fatalf("disconnect forfeit: %+v", w)
+ }
+ } else if w.chips != 100 || len(w.open) != 0 || w.paid != 0 {
t.Fatalf("disconnect refund: %+v", w)
}
}