File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -35,26 +35,22 @@ fn run_file(modname: &str) -> Result<()> {
35
35
return Err ( Error :: runtime ( msg) ) ;
36
36
}
37
37
38
+ // Helper macro to generate Rust test functions for Lua test modules.
38
39
macro_rules! include_tests {
39
- ( $( $ name: ident, ) * ) => {
40
+ ( $( $ ( # [ $meta : meta ] ) ? $ name: ident $ ( , ) ? ) * ) => {
40
41
$(
41
- #[ test]
42
- fn $name( ) -> Result <( ) > {
43
- run_file( stringify!( $name) )
44
- }
42
+ $( #[ $meta] ) *
43
+ #[ test]
44
+ fn $name( ) -> Result <( ) > {
45
+ run_file( stringify!( $name) )
46
+ }
45
47
) *
46
48
} ;
47
-
48
- ( $name: ident) => { include_tests! { $name, } } ;
49
49
}
50
50
51
51
include_tests ! {
52
52
assertions,
53
+ #[ cfg( feature = "json" ) ] json,
54
+ #[ cfg( feature = "regex" ) ] regex,
55
+ #[ cfg( feature = "yaml" ) ] yaml,
53
56
}
54
-
55
- #[ cfg( feature = "json" ) ]
56
- include_tests ! ( json) ;
57
- #[ cfg( feature = "regex" ) ]
58
- include_tests ! ( regex) ;
59
- #[ cfg( feature = "yaml" ) ]
60
- include_tests ! ( yaml) ;
You can’t perform that action at this time.
0 commit comments