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<()> {
3535 return Err ( Error :: runtime ( msg) ) ;
3636}
3737
38+ // Helper macro to generate Rust test functions for Lua test modules.
3839macro_rules! include_tests {
39- ( $( $ name: ident, ) * ) => {
40+ ( $( $ ( # [ $meta : meta ] ) ? $ name: ident $ ( , ) ? ) * ) => {
4041 $(
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+ }
4547 ) *
4648 } ;
47-
48- ( $name: ident) => { include_tests! { $name, } } ;
4949}
5050
5151include_tests ! {
5252 assertions,
53+ #[ cfg( feature = "json" ) ] json,
54+ #[ cfg( feature = "regex" ) ] regex,
55+ #[ cfg( feature = "yaml" ) ] yaml,
5356}
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