diff options
| author | olivia <olivia@fastmail.com> | 2018-05-16 15:27:52 +0200 |
|---|---|---|
| committer | olivia <olivia@fastmail.com> | 2018-05-16 15:27:52 +0200 |
| commit | 39b3e3225ab1473eab954f8ce2458abd6e5671c7 (patch) | |
| tree | 6b53750c62fe5c0bb9002e8e2afa5882af5eb220 | |
| parent | d9946a91d429b2de2d0e21a2f346821f29c6ec5a (diff) | |
add another example
| -rw-r--r-- | src/about_variables.rs | 11 |
1 files changed, 10 insertions, 1 deletions
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(); } |
