From 39b3e3225ab1473eab954f8ce2458abd6e5671c7 Mon Sep 17 00:00:00 2001 From: olivia Date: Wed, 16 May 2018 15:27:52 +0200 Subject: [PATCH] add another example --- src/about_variables.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/about_variables.rs b/src/about_variables.rs index 9e64904..ede3479 100644 --- a/src/about_variables.rs +++ b/src/about_variables.rs @@ -1,4 +1,3 @@ -#[allow(dead_code)] fn guess_this () -> i32 { let one = 5; let two = 7; @@ -7,14 +6,24 @@ fn guess_this () -> i32 { return result; } +fn simple () -> &'static str { + let hello = "Hello World!"; + return hello; +} + mod tests { use super::*; + pub fn test_simple () { + verify!("Hello World!", simple(), "Simple example"); + } + pub fn test_complicated () { verify!(1, guess_this(), "Complicated example"); } } pub fn exec () { + tests::test_simple(); tests::test_complicated(); }