test: cover mobile card label glyphs
Build and Deploy / build-and-push (push) Successful in 1m4s

This commit is contained in:
funman300
2026-06-08 19:13:40 -07:00
parent a69a774edf
commit 324003562b
3 changed files with 26 additions and 4 deletions
+21 -1
View File
@@ -3024,7 +3024,7 @@ mod tests {
}
// -----------------------------------------------------------------------
// label_for — remaining ranks not yet covered
// label_for / mobile_label_for
// -----------------------------------------------------------------------
#[test]
@@ -3081,6 +3081,26 @@ mod tests {
}
}
#[test]
fn mobile_label_for_uses_unicode_suit_glyphs() {
let cases = [
(Suit::Clubs, Rank::Two, "2♣"),
(Suit::Diamonds, Rank::Ten, "10♦"),
(Suit::Hearts, Rank::Queen, "Q♥"),
(Suit::Spades, Rank::Ace, "A♠"),
];
for (suit, rank, expected) in cases {
let card = Card {
id: 0,
suit,
rank,
face_up: true,
};
assert_eq!(mobile_label_for(&card), expected);
}
}
#[test]
fn facedown_cards_use_tighter_fan_than_uniform_faceup_fan() {
let g = GameState::new(42, solitaire_core::game_state::DrawMode::DrawOne);