mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
add a sample
This commit is contained in:
parent
3ffefa32e1
commit
7148233950
1 changed files with 18 additions and 5 deletions
23
src/lib.rs
23
src/lib.rs
|
@ -1,7 +1,20 @@
|
||||||
#[cfg(test)]
|
#[allow(dead_code)]
|
||||||
mod tests {
|
mod about_variables {
|
||||||
#[test]
|
pub fn guess_this () -> i32 {
|
||||||
fn it_works() {
|
let one = 5;
|
||||||
assert_eq!(2 + 2, 4);
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue