aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/manager_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-08-03 14:08:09 -0400
committerhistoria <[not public]>2026-08-03 14:08:09 -0400
commit612e429de438821ae8e099d6b54f87c11ff6c1b5 (patch)
treead6f9edf74339b9b50f9c7c2cd314ee7b6e04b2c /internal/casino/manager_test.go
parentf51424c90dbce7191a31b6e675818c985f0f4539 (diff)
downloadthehouseoficarus-612e429de438821ae8e099d6b54f87c11ff6c1b5.tar.gz
refactor: casino game slop refactor
Diffstat (limited to 'internal/casino/manager_test.go')
-rw-r--r--internal/casino/manager_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/casino/manager_test.go b/internal/casino/manager_test.go
index 245133d..8d6dd3d 100644
--- a/internal/casino/manager_test.go
+++ b/internal/casino/manager_test.go
@@ -64,6 +64,25 @@ func TestMultiplePlayersWaitForBets(t *testing.T) {
m.Bet(1, "slots", "bob", 10, wb)
}
+func TestTableBettingIgnoresDisconnected(t *testing.T) {
+ m := NewManager(1)
+ cfg := TableConfig{ID: "slots", Game: GameSlots, BettingTicks: 20}
+ m.Join(1, cfg, "alice")
+ m.Join(1, cfg, "bob")
+ m.MarkDisconnected("bob")
+ w := &testWallet{credits: 100}
+ events := m.Bet(1, "slots", "alice", 10, w)
+ found := false
+ for _, event := range events {
+ if event.Type == EventRoundStarted {
+ found = true
+ }
+ }
+ if !found {
+ t.Fatal("disconnected player stalled the table's round")
+ }
+}
+
func TestMachineAutobetCountdownAndStop(t *testing.T) {
m := NewManager(1)
cfg := MachineConfig{ID: "slots", Game: GameSlots, SpinTicks: 1}