From 9690fb2bf304299521fee375ea745d11ead2b2f2 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sat, 4 Apr 2026 04:14:49 +0100 Subject: [PATCH] modes:pair:tests: refactor for name change --- src/modes/pair.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/modes/pair.rs b/src/modes/pair.rs index ba5ed2a..051445d 100644 --- a/src/modes/pair.rs +++ b/src/modes/pair.rs @@ -14,7 +14,7 @@ impl Pair { first member of the pair. In other words, Pair::1 will always be a valid playing card. */ - fn new(c1: Card, c2: Card) -> Option { + pub fn new(c1: Card, c2: Card) -> Option { // Order the cards. This means if xor(c1 is joker, c2 is joker) c1 will // be that joker. let [c1, c2] = ordered([c1, c2]); @@ -102,7 +102,7 @@ mod tests { use super::*; use crate::{ card::{make_decks, Rank}, - modes::tests::test_footstool_non_reflexivity, + modes::tests::test_footstool, }; #[test] @@ -245,17 +245,8 @@ mod tests { exhaustive_pairs_deck() .flat_map(|p1| exhaustive_pairs_deck().map(move |p2| (p1, p2))) .for_each(|(p1, p2)| { - let (p1_on_p2, p2_on_p1) = - test_footstool_non_reflexivity(&p1, &p2); - let (hc1_on_hc2, hc2_on_hc1) = { - let high_card_1 = Single::new(p1.1).unwrap(); - let high_card_2 = Single::new(p2.1).unwrap(); - test_footstool_non_reflexivity(&high_card_1, &high_card_2) - }; - - // TEST: We expect pair footstools to mirror footstool rules of - // Singles on the high card. - assert!(p1_on_p2 == hc1_on_hc2 && p2_on_p1 == hc2_on_hc1); + // TEST: Expected footstool condition + test_footstool(&p1, &p2); }); } }