Add a test function
This commit is contained in:
parent
f444fc9406
commit
fbf552fb73
1 changed files with 10 additions and 0 deletions
|
@ -3,3 +3,13 @@ use rand;
|
|||
pub fn add_one(x: i32) -> i32 {
|
||||
x + 1
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(3, add_one(2));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue