add a sample
This commit is contained in:
parent
3ffefa32e1
commit
7148233950
17
src/lib.rs
17
src/lib.rs
|
@ -1,7 +1,20 @@
|
||||||
|
#[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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use super::about_variables::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn it_works() {
|
fn test_complicated () {
|
||||||
assert_eq!(2 + 2, 4);
|
assert_eq!(___, guess_this());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue