standard_card 1.4.0

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

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

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

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

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

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