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
+2
View File
@@ -55,6 +55,8 @@ project follows [Semantic Versioning](https://semver.org/).
### Tests ### Tests
- Added direct coverage for Android/touch card corner labels using Unicode suit
glyphs.
- Added schema-v3 persistence round-trip coverage, foundation-to-tableau - Added schema-v3 persistence round-trip coverage, foundation-to-tableau
instruction coverage, expanded WASM unit tests, and Playwright E2E specs for instruction coverage, expanded WASM unit tests, and Playwright E2E specs for
browser routes and game-canvas behavior. browser routes and game-canvas behavior.
+3 -3
View File
@@ -1,15 +1,15 @@
# Ferrous Solitaire — Session Handoff # Ferrous Solitaire — Session Handoff
**Last updated:** 2026-06-09 — analytics and Android validation runbooks added; handoff current. **Last updated:** 2026-06-09 — validation runbooks added; card label coverage tightened.
--- ---
## Current state ## Current state
- **Branch state:** `master` pushed to origin; latest commits are validation runbooks plus handoff/changelog follow-up. - **Branch state:** `master` pushed to origin; latest commits are validation runbooks plus card-label test coverage.
- **Latest tag:** `v0.39.0` - **Latest tag:** `v0.39.0`
- **Working tree:** clean. Local `scripts/` helpers are excluded through `.git/info/exclude` and intentionally not committed. - **Working tree:** clean. Local `scripts/` helpers are excluded through `.git/info/exclude` and intentionally not committed.
- **Latest verification in this follow-up:** `cargo test -p solitaire_core`; `cargo test -p solitaire_data matomo_client`; `cargo test -p solitaire_engine analytics_plugin`; `cargo test -p solitaire_engine settings_plugin`. - **Latest verification in this follow-up:** `cargo test -p solitaire_core`; `cargo test -p solitaire_data matomo_client`; `cargo test -p solitaire_engine analytics_plugin`; `cargo test -p solitaire_engine settings_plugin`; `cargo test -p solitaire_engine card_plugin`.
- **Full previous gate:** Claude reported recent card_game work pushed to origin and `cargo test` / `clippy` gates passing before the changelog follow-up. - **Full previous gate:** Claude reported recent card_game work pushed to origin and `cargo test` / `clippy` gates passing before the changelog follow-up.
--- ---
+21 -1
View File
@@ -3024,7 +3024,7 @@ mod tests {
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// label_for — remaining ranks not yet covered // label_for / mobile_label_for
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
#[test] #[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] #[test]
fn facedown_cards_use_tighter_fan_than_uniform_faceup_fan() { fn facedown_cards_use_tighter_fan_than_uniform_faceup_fan() {
let g = GameState::new(42, solitaire_core::game_state::DrawMode::DrawOne); let g = GameState::new(42, solitaire_core::game_state::DrawMode::DrawOne);