rust_testing/lib.rs
1//! # My Crate
2//!
3//! `my_crate` is a collection of utilities to make performing certain
4//! calculations more convenient.
5
6/// Adds one to the number given.
7///
8/// # Examples
9/// ```
10/// let five = 5;
11///
12/// assert_eq!(6, rust_test::add_one(five));
13/// ```
14pub fn add_one(x: i32) -> i32 {
15 x + 1
16}
17#[cfg(test)]
18mod tests {
19 #[test]
20 fn it_works() {
21 assert_eq!(2 + 2, 4);
22 }
23}