Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Declaring crate
- macro_rules some_macro {
- if cfg!(test) {
- panic!("boom");
- } else {
- panic!("bang");
- }
- }
- // Consuming crate
- // cargo test --release
- #[cfg(test)]
- mod test {
- #[test]
- fn abc() {
- some_macro!(); // I want this to go boom, but it goes bang
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment