open_pql/functions/
four_flush.rs1use three_flush::n_flush;
2
3use super::*;
4
5#[pqlfn]
6pub fn four_flush(hand: &Hand, street: PQLStreet, board: Board) -> PQLBoolean {
7 n_flush::<4>(hand, board, street)
8}
9
10#[cfg(test)]
11mod tests {
12 use three_flush::tests::has_n_flush;
13
14 use super::*;
15
16 #[quickcheck]
17 fn test_four_flush(hbg: HandBoardGame) -> TestResult {
18 TestResult::from_bool(
19 has_n_flush(&hbg.hand, hbg.board, hbg.street, 4)
20 == four_flush(hbg.hand.as_ref(), hbg.street, hbg.board),
21 )
22 }
23}