standard_card 1.4.0

A Lightweight Library for Efficient Card Representation
Documentation
/// Check if the card's current suit is clubs
///
/// # Arguments
/// `card` - The card number
///
/// # Example
/// ```
/// use standard_card::card::is_clubs;
///
/// let result = is_clubs(268471337);
/// assert_eq!(true, result);
/// ```
pub fn is_clubs(card: i32) -> bool {
    card & 0x8000 != 0
}

#[cfg(test)]
mod is_clubs {
    use crate::card::is_clubs;

    #[test]
    fn ace_of_clubs() {
        // Act
        let actual = is_clubs(268471337);

        // Assert
        assert_eq!(actual, true);
    }

    #[test]
    fn ace_of_diamonds() {
        // Act
        let actual = is_clubs(268455017);

        // Assert
        assert_eq!(actual, false);
    }
}