|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
fn guess_this () -> i32 {
|
|
|
|
|
fn guess_this() -> i32 {
|
|
|
|
|
let one = 5;
|
|
|
|
|
let two = 7;
|
|
|
|
|
let three = 3;
|
|
|
|
@ -6,7 +6,7 @@ fn guess_this () -> i32 {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn simple () -> &'static str {
|
|
|
|
|
fn simple() -> &'static str {
|
|
|
|
|
let hello = "Hello World!";
|
|
|
|
|
return hello;
|
|
|
|
|
}
|
|
|
|
@ -14,16 +14,16 @@ fn simple () -> &'static str {
|
|
|
|
|
mod tests {
|
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
|
|
pub fn test_simple () {
|
|
|
|
|
pub fn test_simple() {
|
|
|
|
|
verify!("Hello World!", simple(), "Simple example");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn test_complicated () {
|
|
|
|
|
pub fn test_complicated() {
|
|
|
|
|
verify!(1, guess_this(), "Complicated example");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn exec () {
|
|
|
|
|
pub fn exec() {
|
|
|
|
|
tests::test_simple();
|
|
|
|
|
tests::test_complicated();
|
|
|
|
|
}
|
|
|
|
|