ci-publish-test 0.1.1

Throwaway crate for testing the GitHub Actions -> crates.io publish cycle
Documentation
//! Throwaway crate to exercise the GitHub Actions -> crates.io publish pipeline.
//!
//! Intentionally contains no real SDK or application logic.

/// Adds two `u8` values, saturating at `u8::MAX` instead of overflowing.
pub fn saturating_add_u8(a: u8, b: u8) -> u8 {
    a.saturating_add(b)
}

#[cfg(test)]
mod tests {
    use super::*;

    // Falsification: if `saturating` were swapped for wrapping (255 + 1 == 0),
    // this fails. `cargo build` can't catch that swap (both compile), so the
    // boundary test is warranted.
    #[test]
    fn saturates_at_max_instead_of_wrapping() {
        assert_eq!(saturating_add_u8(255, 1), 255);
    }

    // Falsification: a degenerate "always return MAX" impl would still pass the
    // boundary test above; ordinary in-range addition must also hold.
    #[test]
    fn adds_normally_within_range() {
        assert_eq!(saturating_add_u8(2, 3), 5);
    }
}