diff options
| author | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 17:31:50 -0400 |
| commit | 516fd29da423432ef6dfded21a984f1d15dcab1a (patch) | |
| tree | eb2dabe325a1335dedac28a93453df643ef986f2 /internal/casino/machine_test.go | |
| parent | e42952469dadfb3535633c66c881050ac128703c (diff) | |
| download | thehouseoficarus-516fd29da423432ef6dfded21a984f1d15dcab1a.tar.gz | |
fix: slop casino and economy fixes
Diffstat (limited to 'internal/casino/machine_test.go')
| -rw-r--r-- | internal/casino/machine_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/casino/machine_test.go b/internal/casino/machine_test.go index 1e8cdad..8942936 100644 --- a/internal/casino/machine_test.go +++ b/internal/casino/machine_test.go @@ -14,6 +14,20 @@ func TestBetRangeTextFormatsUnlimitedMax(t *testing.T) { } } +// Regression: standing up while a feature was banked silently dropped the +// credits; leave must settle them like markDisconnected does. +func TestMachineLeavePaysBankedFeature(t *testing.T) { + m := newMachine(1, MachineConfig{ID: "slots", Game: GameSlots}, rand.New(rand.NewSource(7))) + w := &testWallet{} + m.player = &Participant{Name: "alice", Connected: true, Wallet: w} + m.featureBank = 25 + m.phase = machineReady + _ = m.leave("alice") + if w.paid != 25 { + t.Fatalf("banked feature not paid on leave: paid = %d, want 25", w.paid) + } +} + func TestMachineSetBetUnsetDefaultMaxMessage(t *testing.T) { m := newMachine(1, MachineConfig{ID: "slots", Game: GameSlots, MinBet: 1}, rand.New(rand.NewSource(7))) m.player = &Participant{Name: "alice", Connected: true} |
