aboutsummaryrefslogtreecommitdiff
path: root/internal/game/craps_variants_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-02 14:43:26 -0400
committerhistoria <[not public]>2026-10-02 14:43:26 -0400
commit4f40f116ba884111c9a66849e620ff9fbc67530a (patch)
treeaf407f199be482f9aac997d2cfaa0d86a806d8ff /internal/game/craps_variants_test.go
parent62017c86392b046d746fb4fafef6742840477c5f (diff)
downloadthehouseoficarus-4f40f116ba884111c9a66849e620ff9fbc67530a.tar.gz
feat: compact craps layout, ux cleanup
Diffstat (limited to 'internal/game/craps_variants_test.go')
-rw-r--r--internal/game/craps_variants_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/game/craps_variants_test.go b/internal/game/craps_variants_test.go
index 42f3529..46f5be6 100644
--- a/internal/game/craps_variants_test.go
+++ b/internal/game/craps_variants_test.go
@@ -41,7 +41,7 @@ func TestCrapsVariantRendering(t *testing.T) {
if v == "die_rich" && !strings.Contains(plain, "Total: 4") {
t.Fatal("single die absent")
}
- if mode == "xterm256" && (v == "die_rich" || v == "diceless") {
+ if mode == "xterm256" && v == "diceless" {
bg := 0
if style == "light" {
bg = 15
@@ -50,14 +50,20 @@ func TestCrapsVariantRendering(t *testing.T) {
t.Fatal(v, "style")
}
}
+ if mode == "xterm256" && v == "die_rich" && !strings.Contains(text, color.BgCode(mode, 15)) {
+ t.Fatal(v, "die should use a white background")
+ }
}
}
}
}
for n := 1; n <= 6; n++ {
- text := renderCrapsDice([2]int{n, 0}, "none", false, "dark")
+ text := renderCrapsDice([2]int{n, 0}, "none", false)
if strings.Count(text, "+-------+") != 2 {
- t.Fatal("must render exactly one die", text)
+ t.Fatal("single die needs a top and bottom outline", text)
+ }
+ if got := strings.Count(strings.ReplaceAll(text, "Total:", ""), "o"); got != n {
+ t.Fatalf("single die %d rendered %d pips", n, got)
}
}
}