From 4f40f116ba884111c9a66849e620ff9fbc67530a Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 2 Oct 2026 14:43:26 -0400 Subject: feat: compact craps layout, ux cleanup --- internal/game/craps_variants_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'internal/game/craps_variants_test.go') 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) } } } -- cgit v1.2.3