aboutsummaryrefslogtreecommitdiff
path: root/internal/game/pai_gow_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-01 15:47:17 -0400
committerhistoria <[not public]>2026-10-01 15:47:17 -0400
commitc94728c929045f7c1bdf0166df152d944e5f99bc (patch)
tree3d677caf166da36cd12ae200cc4c5d7a789d5c8f /internal/game/pai_gow_test.go
parent1082f3336085c15992ca83d5553c0ba52208d70a (diff)
downloadthehouseoficarus-c94728c929045f7c1bdf0166df152d944e5f99bc.tar.gz
feat: better casino game look output, more concise table instructions
Diffstat (limited to 'internal/game/pai_gow_test.go')
-rw-r--r--internal/game/pai_gow_test.go53
1 files changed, 50 insertions, 3 deletions
diff --git a/internal/game/pai_gow_test.go b/internal/game/pai_gow_test.go
index 614d0dd..f13655b 100644
--- a/internal/game/pai_gow_test.go
+++ b/internal/game/pai_gow_test.go
@@ -11,7 +11,7 @@ import (
)
func TestPaiGowCommandsLookAndSettlement(t *testing.T) {
- g, sess, conn := casinoCrapsGame(t, "name: Pai Gow\ncasino_tables:\n - id: fortune\n game: pai_gow\n pai_gow:\n envy: true\n")
+ g, sess, conn := casinoCrapsGame(t, "name: Pai Gow\ncasino_tables:\n - id: fortune\n game: paigow\n pai_gow:\n envy: true\n")
g.executePlay(sess, []string{"pai"}, "play pai")
table, playing := g.Casino.Participation(sess.Player.Name)
if !playing || table.Config.Game != casino.GamePaiGow {
@@ -20,7 +20,7 @@ func TestPaiGowCommandsLookAndSettlement(t *testing.T) {
conn.data = nil
g.executeTableStatus(sess, []string{"rules"}, "table rules")
text := stripANSI(string(conn.data))
- for _, want := range []string{"FORTUNE", "ENVY (FIXED)", "750:1", "Three pair"} {
+ for _, want := range []string{"FORTUNE", "ENVY", "750:1", "Three pair"} {
if !strings.Contains(text, want) {
t.Fatalf("missing %s: %s", want, text)
}
@@ -102,10 +102,22 @@ func TestPaiGowFeltAndJokerAllModes(t *testing.T) {
if !strings.Contains(felt, "Three pair") || !strings.Contains(felt, "1000:1") {
t.Fatal(felt)
}
+ // The felt shows only the limit and commission; the per-state command
+ // hints come from the live menu, not baked-in felt text.
+ for _, want := range []string{"LIMITS", "ODDS", "COMMISSION", "Copies lose"} {
+ if !strings.Contains(felt, want) {
+ t.Fatalf("missing %q: %s", want, felt)
+ }
+ }
+ for _, gone := range []string{"PROFIT ODDS", "FIVE HIGH / TWO LOW", "MAIN WIN", "24 sets cards", "Bet main, optional"} {
+ if strings.Contains(felt, gone) {
+ t.Fatalf("stale felt text %q: %s", gone, felt)
+ }
+ }
if !envy && (!strings.Contains(felt, "ENVY OFF") || !strings.Contains(felt, "30:1")) {
t.Fatal(felt)
}
- if cfg.PaiGow.Envy && (strings.Contains(felt, "ENVY OFF") || !strings.Contains(felt, "ENVY (FIXED)")) {
+ if cfg.PaiGow.Envy && (strings.Contains(felt, "ENVY OFF") || !strings.Contains(felt, "ENVY") || !strings.Contains(felt, "Envy pays when other players hit quads or better.")) {
t.Fatal(felt)
}
}
@@ -116,6 +128,41 @@ func TestPaiGowFeltAndJokerAllModes(t *testing.T) {
t.Fatal(felt)
}
}
+func TestPaiGowContextHintsFollowState(t *testing.T) {
+ g, sess, conn := casinoCrapsGame(t, "name: Pai Gow\ncasino_tables:\n - id: fortune\n game: paigow\n min_bet: 5\n max_bet: 1000\n pai_gow:\n envy: true\n")
+ g.executePlay(sess, []string{"pai"}, "play pai")
+
+ // A fresh bettor is told how to place the main wager.
+ conn.data = nil
+ g.executeTableStatus(sess, nil, "table")
+ text := stripANSI(string(conn.data))
+ if !strings.Contains(text, "bet <amount>") {
+ t.Fatalf("missing main-bet hint: %s", text)
+ }
+
+ // After the main wager the live menu offers Fortune and deal, not a second
+ // main bet, and the shared tail is present.
+ conn.data = nil
+ g.executeBet(sess, []string{"20"}, "bet 20")
+ text = stripANSI(string(conn.data))
+ for _, want := range []string{"bet <amount> fortune", "deal", "table rules", "rules", "stop"} {
+ if !strings.Contains(text, want) {
+ t.Fatalf("missing %q after main bet: %s", want, text)
+ }
+ }
+
+ // Setting offers the split selectors and the house-way shortcut.
+ g.executeBet(sess, []string{"5", "fortune"}, "bet 5 fortune")
+ g.executeTableAction(sess, "deal")
+ conn.data = nil
+ g.executeTableStatus(sess, nil, "table")
+ text = stripANSI(string(conn.data))
+ for _, want := range []string{"24 / 13456", "house"} {
+ if !strings.Contains(text, want) {
+ t.Fatalf("missing %q while setting: %s", want, text)
+ }
+ }
+}
func TestVestaPaiGowRooms(t *testing.T) {
_, rooms, _ := loadVesta(t)
for id, variant := range map[int]string{6195: casino.PaiGowClassic, 6196: casino.PaiGowEZ, 6197: casino.PaiGowNoPush, 6198: casino.PaiGowFaceUp} {