@@ -102,7 +102,7 @@ macro_rules! _test_parse {
102102 } ;
103103
104104 // End result
105- ( break : name=$name: ident body=[ $( $item: tt) * ] $( ignore=$ignore: tt) ? $( should_panic=$should_panic: tt) ?) => {
105+ ( break : name=$name: ident body=[ ( $ ( $params : tt ) * ) $( $item: tt) * ] $( ignore=$ignore: tt) ? $( should_panic=$should_panic: tt) ?) => {
106106 #[ allow( non_camel_case_types) ]
107107 struct $name;
108108
@@ -125,12 +125,12 @@ macro_rules! _test_parse {
125125 }
126126
127127 fn run( & self , context: & $crate:: TestContext ) -> $crate:: RunResult {
128- fn run $( $item) *
128+ fn run( $ ( $params ) * ) $( $item) *
129129
130130 $crate:: _private:: parse_ignore!( context, $( $ignore) ?) ;
131131
132132 use $crate:: IntoRunResult ;
133- let result = $crate:: _private:: run_test!( context, $( $should_panic) ?) ;
133+ let result = $crate:: _private:: run_test!( $crate :: _private :: test_expr! ( context, [ $ ( $params ) * ] ) , $( $should_panic) ?) ;
134134 IntoRunResult :: into_run_result( result)
135135 }
136136 }
@@ -151,14 +151,25 @@ macro_rules! _parse_ignore {
151151
152152#[ macro_export]
153153#[ doc( hidden) ]
154- macro_rules! _run_test {
155- ( $context: expr, [ $expected: literal] ) => {
156- $crate:: panic:: assert_panic_contains( || run( $context) , $expected)
157- } ;
154+ macro_rules! _test_expr {
158155 ( $context: expr, [ ] ) => {
159- $crate :: panic :: assert_panic ( || run( $context ) )
156+ run( )
160157 } ;
161- ( $context: expr $ ( , ) ? ) => { {
158+ ( $context: expr, [ $ ( $params : tt ) + ] ) => {
162159 run( $context)
160+ } ;
161+ }
162+
163+ #[ macro_export]
164+ #[ doc( hidden) ]
165+ macro_rules! _run_test {
166+ ( $test: expr, [ $expected: literal] ) => {
167+ $crate:: panic:: assert_panic_contains( || $test, $expected)
168+ } ;
169+ ( $test: expr, [ ] ) => {
170+ $crate:: panic:: assert_panic( || $test)
171+ } ;
172+ ( $test: expr $( , ) ?) => { {
173+ $test
163174 } } ;
164175}
0 commit comments