aboutsummaryrefslogtreecommitdiff
path: root/internal/game/video_poker_alignment_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-10-03 01:38:58 -0400
committerhistoria <[not public]>2026-10-03 01:38:58 -0400
commit0ec8f3692960a064616e630c914058298b22897b (patch)
tree2b51327eb66be7df8fdcd7c12cc306ca6fa84891 /internal/game/video_poker_alignment_test.go
parent82e571d227feeafd0af4011e701ce26b99c5e3d9 (diff)
downloadthehouseoficarus-0ec8f3692960a064616e630c914058298b22897b.tar.gz
feat: replaced roulette wheel graphic with line-by-line 'spin'
Diffstat (limited to 'internal/game/video_poker_alignment_test.go')
-rw-r--r--internal/game/video_poker_alignment_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/game/video_poker_alignment_test.go b/internal/game/video_poker_alignment_test.go
new file mode 100644
index 0000000..0163fac
--- /dev/null
+++ b/internal/game/video_poker_alignment_test.go
@@ -0,0 +1,35 @@
+package game
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+
+ "thehouseoficarus/internal/casino"
+)
+
+func TestPokerMultiHandCardRowsAlignWithLabels(t *testing.T) {
+ cards := []casino.CardView{{Rank: "A", Suit: "hearts"}, {Rank: "K", Suit: "spades"}, {Rank: "Q", Suit: "diamonds"}, {Rank: "J", Suit: "clubs"}, {Rank: "10", Suit: "hearts"}}
+ for _, size := range []int{1, 3, 5} {
+ t.Run(fmt.Sprint(size), func(t *testing.T) {
+ hand := casino.PokerLine{Cards: cards, Category: "Straight", Coins: 20, Multiplier: 1}
+ snap := &casino.VideoPokerSnapshot{Config: (casino.VideoPokerConfig{Cabinet: casino.CabinetClassic}).Normalize(), Hands: 3, Lines: []casino.PokerLine{hand, hand, hand}}
+ out := renderVideoPoker(snap, "none", true, size, "", nil)
+ art := renderPokerCards(cards, nil, "none", true, min(5, cardRenderSize(true, size)), "", nil)
+ for n := 1; n <= 3; n++ {
+ rows := append([]string(nil), art...)
+ for i := range rows {
+ prefix := " "
+ if i == 0 {
+ prefix = fmt.Sprintf("%3d: ", n)
+ }
+ rows[i] = prefix + rows[i]
+ }
+ want := strings.Join(rows, "\n") + "\n Straight"
+ if !strings.Contains(out, want) {
+ t.Fatalf("hand %d is misaligned:\n%s", n, out)
+ }
+ }
+ })
+ }
+}