rust/tests/ui/test-attrs/decl-macro-test.rs

23 lines
315 B
Rust
Raw Permalink Normal View History

2019-08-25 20:03:24 +00:00
// Check that declarative macros can declare tests
//@ check-pass
//@ compile-flags: --test
2019-08-25 20:03:24 +00:00
#![feature(decl_macro)]
macro create_test() {
#[test]
fn test() {}
}
macro create_module_test() {
mod x {
#[test]
fn test() {}
}
}
create_test!();
create_test!();
create_module_test!();