From 71482339503933d2ac94361ef34270dfa7de35ea Mon Sep 17 00:00:00 2001 From: olivia Date: Thu, 26 Apr 2018 22:14:20 +0200 Subject: [PATCH] add a sample --- src/lib.rs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 31e1bb2..9adcf56 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,20 @@ -#[cfg(test)] -mod tests { - #[test] - fn it_works() { - assert_eq!(2 + 2, 4); +#[allow(dead_code)] +mod about_variables { + pub fn guess_this () -> i32 { + let one = 5; + let two = 7; + let three = 3; + let result = (one + two) / three; + result + } +} + +#[cfg(test)] +mod tests { + use super::about_variables::*; + + #[test] + fn test_complicated () { + assert_eq!(___, guess_this()); } }