rustlings/exercises/test4.rs
2019-07-22 21:01:15 -04:00

20 lines
357 B
Rust

// test4.rs
// This test covers the sections:
// - Modules
// - Macros
// Write a macro that passes the test! No hints this time, you can do it!
#[macro_export]
macro_rules! my_macro {
($x:expr) => {{
format!("Hello {}", $x)
}};
}
fn main() {
if my_macro!("world!") != "Hello world!" {
panic!("Oh no! Wrong output!");
}
}