diff options
| author | historia <[not public]> | 2026-09-05 16:31:22 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-05 16:31:22 -0400 |
| commit | f4ea40c4b3589104dfaced3481ba19c5735889ae (patch) | |
| tree | 66ead13206e52a65e64d6ba5d1576b63954682e9 /internal/casino/machine_test.go | |
| parent | 9a716a7d2ce514f452b425caedc1a9a15cde09f0 (diff) | |
| download | thehouseoficarus-main.tar.gz | |
Diffstat (limited to 'internal/casino/machine_test.go')
| -rw-r--r-- | internal/casino/machine_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/casino/machine_test.go b/internal/casino/machine_test.go index 79d38fc..53fe2e6 100644 --- a/internal/casino/machine_test.go +++ b/internal/casino/machine_test.go @@ -5,6 +5,24 @@ import ( "testing" ) +func TestBetRangeTextFormatsUnlimitedMax(t *testing.T) { + if got := betRangeText(1, maxBetUnlimited); got != "1 or more (no maximum)" { + t.Fatalf("unlimited range=%q", got) + } + if got := betRangeText(5, 100); got != "between 5 and 100" { + t.Fatalf("bounded range=%q", got) + } +} + +func TestMachineSetBetUnlimitedMaxMessage(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} + events := m.setBet("alice", 0, &testWallet{credits: 100}) + if !hasMessage(events, "Slot machine bets must be 1 or more (no maximum).") { + t.Fatalf("unexpected bet-range message: %+v", events) + } +} + func TestMachineFreeSpinsUseProfileCount(t *testing.T) { m := newMachine(1, MachineConfig{ID: "slots", Game: GameSlots}, rand.New(rand.NewSource(7))) m.profile.FreeSpinCount = 5 |
