From 8b971ffab6079a706ac925f5917f987932b55c07 Mon Sep 17 00:00:00 2001 From: Stig Johan Berggren Date: Tue, 25 Feb 2020 14:13:10 +0100 Subject: [PATCH] Enable test for exercise test4 --- exercises/test4.rs | 11 ++++++++--- info.toml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/exercises/test4.rs b/exercises/test4.rs index c543a64..f3875cf 100644 --- a/exercises/test4.rs +++ b/exercises/test4.rs @@ -7,8 +7,13 @@ // I AM NOT DONE -fn main() { - if my_macro!("world!") != "Hello world!" { - panic!("Oh no! Wrong output!"); +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_my_macro() { + assert_eq!(my_macro!("world!"), "Hello world!"); } } + diff --git a/info.toml b/info.toml index 2e6b0b4..4b89029 100644 --- a/info.toml +++ b/info.toml @@ -369,7 +369,7 @@ The way macros are written, it wants to see something between each [[exercises]] name = "test4" path = "exercises/test4.rs" -mode = "compile" +mode = "test" hint = "No hints this time ;)" # MOVE SEMANTICS