card:tests: use Card::is_joker
This commit is contained in:
@@ -155,10 +155,7 @@ mod test_numerics {
|
|||||||
let card = Card::from(i);
|
let card = Card::from(i);
|
||||||
|
|
||||||
// TEST: Card::from(negative number) makes jokers.
|
// TEST: Card::from(negative number) makes jokers.
|
||||||
assert!(
|
assert!(card.is_joker(), "Expected Card::from({i}) makes jokers");
|
||||||
matches!(card, Card::Joker(_)),
|
|
||||||
"Expected Card::from({i}) makes jokers"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Card::from should defer to PlayingCard::try_from for positive
|
// Card::from should defer to PlayingCard::try_from for positive
|
||||||
@@ -389,7 +386,7 @@ mod test_impls {
|
|||||||
|
|
||||||
// TEST: Expect there to be 2 jokers per deck of cards input.
|
// TEST: Expect there to be 2 jokers per deck of cards input.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
cards.iter().filter(|n| matches!(n, Card::Joker(_))).count(),
|
cards.iter().filter(|n| n.is_joker()).count(),
|
||||||
(2 * decks) as usize,
|
(2 * decks) as usize,
|
||||||
"Expected there to be {} jokers in Card::iter_all({})",
|
"Expected there to be {} jokers in Card::iter_all({})",
|
||||||
2 * decks,
|
2 * decks,
|
||||||
|
|||||||
Reference in New Issue
Block a user