~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/cargo-test

Two small crates, published to knotless's Cargo registry to try it

0
0
main
13 lines · 293 B Raw History
/// A greeting for `who`.
pub fn greet(who: &str) -> String {
    let said = format!("Hello, {who}!");
    if cfg!(feature = "loud") { said.to_uppercase() } else { said }
}

#[cfg(test)]
mod tests {
    #[test]
    fn greets() {
        assert_eq!(super::greet("you"), "Hello, you!");
    }
}