rust-exercises/adder/src/lib.rs

20 lines
290 B
Rust
Raw Normal View History

2025-03-02 21:49:23 +00:00
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
2025-03-02 21:57:58 +00:00
fn exploration() {
2025-03-02 21:49:23 +00:00
let result = add(2, 2);
assert_eq!(result, 4);
}
2025-03-02 21:59:36 +00:00
#[test]
fn another() {
panic!("Make this test fail");
}
2025-03-02 21:49:23 +00:00
}