@@ -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
@@ -123,12 +123,12 @@ macro_rules! _test_parse {
123123 }
124124
125125 fn run( & self , context: & $crate:: TestContext ) -> $crate:: RunResult {
126- fn run $( $item) *
126+ fn run( $ ( $params ) * ) $( $item) *
127127
128128 $crate:: _private:: parse_ignore!( context, $( $ignore) ?) ;
129129
130130 use $crate:: IntoRunResult ;
131- let result = $crate:: _private:: run_test!( context, $( $should_panic) ?) ;
131+ let result = $crate:: _private:: run_test!( $crate :: _private :: test_expr! ( context, [ $ ( $params ) * ] ) , $( $should_panic) ?) ;
132132 IntoRunResult :: into_run_result( result)
133133 }
134134 }
@@ -149,14 +149,25 @@ macro_rules! _parse_ignore {
149149
150150#[ macro_export]
151151#[ doc( hidden) ]
152- macro_rules! _run_test {
153- ( $context: expr, [ $expected: literal] ) => {
154- $crate:: panic:: assert_panic_contains( || run( $context) , $expected)
155- } ;
152+ macro_rules! _test_expr {
156153 ( $context: expr, [ ] ) => {
157- $crate :: panic :: assert_panic ( || run( $context ) )
154+ run( )
158155 } ;
159- ( $context: expr $ ( , ) ? ) => { {
156+ ( $context: expr, [ $ ( $params : tt ) + ] ) => {
160157 run( $context)
158+ } ;
159+ }
160+
161+ #[ macro_export]
162+ #[ doc( hidden) ]
163+ macro_rules! _run_test {
164+ ( $test: expr, [ $expected: literal] ) => {
165+ $crate:: panic:: assert_panic_contains( || $test, $expected)
166+ } ;
167+ ( $test: expr, [ ] ) => {
168+ $crate:: panic:: assert_panic( || $test)
169+ } ;
170+ ( $test: expr $( , ) ?) => { {
171+ $test
161172 } } ;
162173}
0 commit comments