aboba_test_crate/lib.rs
1//! Just testing out
2
3/// # Examples
4///
5/// ```
6/// use playground::add_two;
7///
8/// let res = add_two(5);
9/// assert_eq!(res, 7);
10/// ```
11pub fn add_two(n: i32) -> i32 {
12 add(n, 2)
13}
14
15fn add(n1: i32, n2: i32) -> i32 {
16 n1 + n2
17}
18
19#[cfg(test)]
20mod tests {
21 use super::*;
22
23 #[test]
24 fn test_add_two() {
25 assert_eq!(add_two(5), 7);
26 }
27
28 #[test]
29 fn test_add() {
30 assert_eq!(add(5, 5), 10);
31 }
32}