aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 20:03:13 -0400
committerhistoria <[not public]>2026-09-18 20:03:13 -0400
commit79764732406d6484f67d3dec045483dcb5d08c28 (patch)
tree7a64e8581a540b97ed554f5723e2d587424ab1c6 /internal/game/casino_test.go
parentf1e461ab6aec6b9bf056bbe2daa88a251e0f21da (diff)
downloadthehouseoficarus-79764732406d6484f67d3dec045483dcb5d08c28.tar.gz
feat: better card ascii art
Diffstat (limited to 'internal/game/casino_test.go')
-rw-r--r--internal/game/casino_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/game/casino_test.go b/internal/game/casino_test.go
index 026415f..ffd9958 100644
--- a/internal/game/casino_test.go
+++ b/internal/game/casino_test.go
@@ -74,6 +74,14 @@ func TestExecuteBetParsesBaccaratSpots(t *testing.T) {
if !strings.Contains(string(conn.data), "must be on player, banker, or tie") {
t.Fatalf("bet red 100: expected spot rejection, got %q", string(conn.data))
}
+ // A numeric token AFTER "on" is the target, not a second amount, so
+ // numeric spots (roulette numbers, craps hard ways) reach the table.
+ // Baccarat rejects the value, which proves the parser forwarded it.
+ conn.data = nil
+ g.executeBet(sess, []string{"5", "on", "17"}, "bet 5 on 17")
+ if !strings.Contains(string(conn.data), "must be on player, banker, or tie") {
+ t.Fatalf("bet 5 on 17: expected the table to receive the numeric spot, got %q", string(conn.data))
+ }
// Two amounts or two spots are usage errors.
for _, args := range [][]string{{"10", "20"}, {"player", "banker"}} {
conn.data = nil
@@ -95,7 +103,7 @@ func TestCasinoMenuRendersAlignedColoredCommands(t *testing.T) {
conn := &casinoTestConn{}
sess := &net.Session{Player: player.New("alice"), Conn: conn}
g.loggedInChars = map[string]*net.Session{"alice": sess}
- menu := &casino.MenuView{Kind: casino.MenuSlotCommands, Commands: []casino.MenuCommand{
+ menu := &casino.MenuView{Heading: "Your slot machine bet is set to 10.", ShowBalance: true, Commands: []casino.MenuCommand{
{Command: "bet <amount>", Desc: "Set your wager"},
{Command: "spin", Desc: "Spin using your current wager"},
}}