blob: 9e31c22697053c6ef01b6502cb3ef54b88eaaaf5 [file] [log] [blame]
//! https://doc.rust-lang.org/rust-by-example/testing/unit_testing.html
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
#[cfg(test)]
mod tests {
// Note this useful idiom: importing names from outer (for mod tests) scope.
use super::*;
#[test]
fn test_add() {
assert_eq!(add(1, 2), 3);
}
}