aboutsummaryrefslogtreecommitdiff
path: root/internal/game/video_poker_render_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/video_poker_render_test.go')
-rw-r--r--internal/game/video_poker_render_test.go24
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, "♥") {