aboutsummaryrefslogtreecommitdiff
path: root/internal/game/casino_commands_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/casino_commands_test.go')
-rw-r--r--internal/game/casino_commands_test.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/internal/game/casino_commands_test.go b/internal/game/casino_commands_test.go
index 0ae1593..5e05d4e 100644
--- a/internal/game/casino_commands_test.go
+++ b/internal/game/casino_commands_test.go
@@ -102,25 +102,27 @@ func TestCasinoCompactHintsUseOnlyAvailableCommands(t *testing.T) {
}
func TestSimplifiedFeltSpacingAndNoIdlePrompt(t *testing.T) {
text := renderCrapsSnapshot(&casino.CrapsSnapshot{Variant: "simplified"}, "none", true)
- for _, want := range []string{"DICE TOTAL", "NET PROFIT", "3 or 4", "1:1 (even money)", "10 or 11", "LOSE STAKE", "ONE ROLL", "stake back"} {
+ for _, want := range []string{"SIMPLIFIED CRAPS", "DICE TOTAL", "PAYOUT", "3 or 4", "1:1", "10 or 11", "LOSE STAKE"} {
if !strings.Contains(text, want) {
t.Fatalf("missing %q: %s", want, text)
}
}
- if strings.Contains(text, "WINS PAY 1:1") || strings.Contains(text, "COME-OUT") {
- t.Fatal("stale simplified rules", text)
+ for _, stale := range []string{"even money", "NET PROFIT", "stake back", "PASS ONLY", "ONE ROLL", "COME-OUT"} {
+ if strings.Contains(text, stale) {
+ t.Fatalf("stale simplified rules %q", stale)
+ }
}
if strings.Contains(text, "Place a bet, then roll when ready.") {
t.Fatal(text)
}
- rows := strings.Split(text, "\n")
- for i, row := range rows {
- if strings.Contains(row, "PASS ONLY") {
- if i+1 >= len(rows) || strings.Trim(rows[i+1], "│ ") != "" || !strings.HasPrefix(rows[i+2], "└") {
- t.Fatal("expected exactly one blank footer row", text)
- }
- return
+ rows := strings.Split(strings.TrimSuffix(text, "\n"), "\n")
+ for i := 0; i < len(rows)-1; i++ {
+ if strings.TrimSpace(rows[i]) == "" && strings.TrimSpace(rows[i+1]) == "" {
+ t.Fatalf("consecutive blank lines at %d: %q", i, text)
}
}
- t.Fatal("missing pass label")
+ // The paytable ends at its own bottom border: no footer block remains.
+ if strings.Count(text, "─") == 0 || strings.Contains(text, "NO POINT, ODDS") {
+ t.Fatalf("stale footer: %q", text)
+ }
}