diff options
| author | historia <[not public]> | 2026-10-01 04:45:05 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-01 04:45:05 -0400 |
| commit | 299b5b67aa80ba2539d7a91c60943060b0426b45 (patch) | |
| tree | 9b2ddf8dac25c24eec74766330345b80e7ab5311 /internal/game/video_poker_render_test.go | |
| parent | 0ba388bbe229dd1ccfcb0831d21a5542ae0935f1 (diff) | |
| download | thehouseoficarus-299b5b67aa80ba2539d7a91c60943060b0426b45.tar.gz | |
fix: light mode casino card rendering, video poker machine names
Diffstat (limited to 'internal/game/video_poker_render_test.go')
| -rw-r--r-- | internal/game/video_poker_render_test.go | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/internal/game/video_poker_render_test.go b/internal/game/video_poker_render_test.go index d618c36..8195e21 100644 --- a/internal/game/video_poker_render_test.go +++ b/internal/game/video_poker_render_test.go @@ -5,10 +5,29 @@ import ( "strings" "testing" + "thehouseoficarus/internal/cardart" "thehouseoficarus/internal/casino" "thehouseoficarus/internal/color" ) +// Pip art from data/cards.yaml is shared by every game. In the light card +// style its dark box frame must still give way to the half-block edges that +// meet the white body, or the top and bottom rows look like the dark style. +func TestPokerLightStyleUsesHalfBlockEdgesForPipArt(t *testing.T) { + store := cardart.Load("../../data/cards.yaml") + cards := []casino.CardView{{Rank: "K", Suit: "spades"}} + for _, size := range []int{7, 9} { + lines := renderPokerCards(cards, nil, "none", true, size, "light", store) + if len(lines) != size { + t.Fatalf("size %d: got %d lines", size, len(lines)) + } + top, bottom := strings.TrimSpace(lines[0]), strings.TrimSpace(lines[size-1]) + if top != strings.Repeat("▄", size) || bottom != strings.Repeat("▀", size) { + t.Fatalf("size %d: light edges are not half blocks: top=%q bottom=%q", size, top, bottom) + } + } +} + func TestPokerPayTableBordersPaletteAndColumns(t *testing.T) { for _, cabinet := range []string{casino.CabinetClassic, casino.CabinetUXSingle, casino.CabinetUXMulti} { cfg := (casino.VideoPokerConfig{Cabinet: cabinet, Variant: "double_double_bonus"}).Normalize() @@ -76,9 +95,12 @@ func TestPokerResultsBelowCardsAndHoldStyle(t *testing.T) { t.Fatalf("missing result styling: %q", out) } plain := stripANSI(out) + if strings.Contains(plain, "CLASSIC") { + t.Fatalf("classic badge leaked into output: %s", plain) + } result := strings.Index(plain, text) // The result starts its own line and follows the card/badge line. - if result < 0 || result == 0 || plain[result-1] != '\n' || strings.Index(plain, "CLASSIC") > result { + if result < 0 || result == 0 || plain[result-1] != '\n' { t.Fatalf("result not below cards: %s", plain) } if hands == 100 && !strings.Contains(plain, "♥") { |
