diff --git a/exercises/test4.rs b/exercises/test4.rs index c543a648..ad1f6ac5 100644 --- a/exercises/test4.rs +++ b/exercises/test4.rs @@ -7,8 +7,17 @@ // 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_world() { + assert_eq!(my_macro!("world!"), "Hello world!"); + } + + #[test] + fn test_my_macro_goodbye() { + assert_eq!(my_macro!("goodbye!"), "Hello goodbye!"); } } diff --git a/info.toml b/info.toml index 2e6b0b41..4b89029c 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