aboutsummaryrefslogtreecommitdiff
path: root/internal/game/pai_gow_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-04 17:44:27 -0400
committerhistoria <[not public]>2026-10-04 17:44:27 -0400
commit93dcb67ffee05ebf1de0c9a78a8b906eaf161007 (patch)
tree88cdd3d732f11eee616698a9ca32f699d2b41d77 /internal/game/pai_gow_test.go
parent3a39a020e4449bc4d6f728ef837cffb9f7bd0c56 (diff)
downloadthehouseoficarus-93dcb67ffee05ebf1de0c9a78a8b906eaf161007.tar.gz
feat: new casino game: cash hunt, fixed verb issue with pai gow
Diffstat (limited to 'internal/game/pai_gow_test.go')
-rw-r--r--internal/game/pai_gow_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/game/pai_gow_test.go b/internal/game/pai_gow_test.go
index 830b080..35aee4e 100644
--- a/internal/game/pai_gow_test.go
+++ b/internal/game/pai_gow_test.go
@@ -416,3 +416,23 @@ func TestPaiGowStopMidRoundQueuesDeparture(t *testing.T) {
t.Fatal("queued stop did not leave after the round")
}
}
+
+func TestPaiGowSeatedVerbsReachGame(t *testing.T) {
+ // house/set are not shared-registry verbs; a seated player must still be
+ // able to type them instead of getting "Unknown command".
+ g, sess, conn := casinoCrapsGame(t, "name: Pai Gow\ncasino_tables:\n - id: fortune\n game: paigow\n")
+ g.executePlay(sess, []string{"pai"}, "play pai")
+ g.executeBet(sess, []string{"5", "fortune"}, "bet 5 fortune")
+ g.executeBet(sess, []string{"20"}, "bet 20")
+ for _, verb := range []string{"house", "set"} {
+ conn.data = nil
+ g.handleGameCommand(sess, verb)
+ if strings.Contains(string(conn.data), "Unknown command") {
+ t.Fatalf("%s was rejected before reaching Pai Gow: %s", verb, conn.data)
+ }
+ }
+ table, _ := g.Casino.Participation(sess.Player.Name)
+ if table.Status(sess.Player.Name)[0].Snapshot.(*casino.PaiGowSnapshot).Phase != "waiting" {
+ t.Fatal("house/set did not finish the hand")
+ }
+}