goran_test/lib.rs
1//! # My Crate
2//!
3//! `my_crate` is a collection of utilities to make performing certain
4//! calculations more convenient.
5/// adds one to the number given
6/// # Examples
7/// ```
8/// let arg = 5;
9/// let answer = my_crate::add_one(arg);
10///
11/// assert_eq!(6, answer);
12/// ```
13pub fn add_one(left: usize) -> usize {
14 left + 1
15}
16
17#[cfg(test)]
18mod tests {
19 use super::*;
20
21 #[test]
22 fn it_works() {
23 let result = add_one(3);
24 assert_eq!(result, 4);
25 }
26}