aboutsummaryrefslogtreecommitdiff
path: root/internal/casino/machine_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-05 16:31:22 -0400
committerhistoria <[not public]>2026-09-05 16:31:22 -0400
commitf4ea40c4b3589104dfaced3481ba19c5735889ae (patch)
tree66ead13206e52a65e64d6ba5d1576b63954682e9 /internal/casino/machine_test.go
parent9a716a7d2ce514f452b425caedc1a9a15cde09f0 (diff)
downloadthehouseoficarus-f4ea40c4b3589104dfaced3481ba19c5735889ae.tar.gz
fix: max bet no longer listed numerically, non-bettors can leave mid-roundHEADmain
Diffstat (limited to 'internal/casino/machine_test.go')
-rw-r--r--internal/casino/machine_test.go18
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