ruml_ox/lib.rs
1pub fn add(left: usize, right: usize) -> usize {
2 left + right
3}
4
5/// Returns an epic greeting.
6pub fn hello() -> String {
7 "Well, hello there!".to_string()
8}
9
10#[cfg(test)]
11mod tests {
12 use super::*;
13
14 #[test]
15 fn it_works() {
16 let result = add(2, 2);
17 assert_eq!(result, 4);
18 }
19
20 #[test]
21 fn it_works_2() {
22 assert_eq!(hello(), "Well, hello there!");
23 }
24}