diff options
Diffstat (limited to 'internal/casino/roulette_history_test.go')
| -rw-r--r-- | internal/casino/roulette_history_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/casino/roulette_history_test.go b/internal/casino/roulette_history_test.go index fbd2f65..8ac84a7 100644 --- a/internal/casino/roulette_history_test.go +++ b/internal/casino/roulette_history_test.go @@ -22,8 +22,9 @@ func TestRouletteHistoryTracksCompletedSpinsOnly(t *testing.T) { if !reflect.DeepEqual(before.History, expected) { t.Fatalf("history changed on bet: %v", before.History) } - // Two betting ticks, then two spinning ticks. No sample until the last. - for j := 0; j < 3; j++ { + // A lone player's spin starts at once; the sample only appears on + // the settling tick, never before. + for j := 0; j < table.Config.Roulette.SpinTicks-1; j++ { table.tick() if !reflect.DeepEqual(table.view().History, expected) { t.Fatal("history revealed before settlement") @@ -67,9 +68,10 @@ func TestRouletteHistoryTracksCompletedSpinsOnly(t *testing.T) { func TestRouletteCancelledSpinDoesNotEnterHistory(t *testing.T) { table := rouletteFixture() table.join("a") + table.join("idle") table.bet("a", "red", 1, &testWallet{chips: 100}) - table.tick() - table.tick() + // With a second seat the wager sits in the timed betting window, so the + // spin can still be cancelled by a disconnect. table.markDisconnected("a") table.tick() table.tick() |
