File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,10 +18,6 @@ impl Harness {
1818 Self { raw, cases : vec ! [ ] }
1919 }
2020
21- pub fn case ( & mut self , case : impl Case + ' static ) {
22- self . cases . push ( Box :: new ( case) ) ;
23- }
24-
2521 pub fn cases ( & mut self , cases : impl IntoIterator < Item = impl Case + ' static > ) {
2622 for case in cases {
2723 self . cases . push ( Box :: new ( case) ) ;
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ use libtest2_mimic::Trial;
55
66fn main ( ) {
77 libtest2_mimic:: Harness :: with_env ( )
8- . case ( Trial :: test ( "check_toph" , check_toph) )
9- . case ( Trial :: test ( "check_katara" , check_katara) )
10- . case ( Trial :: test ( "check_sokka" , check_sokka) )
11- . case ( Trial :: test ( "long_computation" , long_computation) )
12- . case ( Trial :: test ( "compile_fail_dummy" , compile_fail_dummy) )
8+ . cases ( [
9+ Trial :: test ( "check_toph" , check_toph) ,
10+ Trial :: test ( "check_katara" , check_katara) ,
11+ Trial :: test ( "check_sokka" , check_sokka) ,
12+ Trial :: test ( "long_computation" , long_computation) ,
13+ Trial :: test ( "compile_fail_dummy" , compile_fail_dummy) ,
14+ ] )
1315 . main ( ) ;
1416}
1517
Original file line number Diff line number Diff line change @@ -43,11 +43,6 @@ impl Harness {
4343 }
4444 }
4545
46- pub fn case ( mut self , case : Trial ) -> Self {
47- self . harness . case ( TrialCase { inner : case } ) ;
48- self
49- }
50-
5146 pub fn cases ( mut self , cases : impl IntoIterator < Item = Trial > ) -> Self {
5247 self . harness
5348 . cases ( cases. into_iter ( ) . map ( |c| TrialCase { inner : c } ) ) ;
Original file line number Diff line number Diff line change @@ -76,8 +76,10 @@ macro_rules! libtest2_main {
7676 ( $( $test: path ) ,* $( , ) * ) => {
7777 fn main( ) {
7878 let mut harness = :: libtest2:: Harness :: with_env( ) ;
79- $( harness. case( :: libtest2:: Trial :: test( :: std:: stringify!( $test) , $test) ) ; ) *
80- harness. main( ) ;
79+ harness. cases( [
80+ $( :: libtest2:: Trial :: test( :: std:: stringify!( $test) , $test) ) ,*
81+ ] ) ;
82+ harness. main( ) ;
8183 }
8284 }
8385}
You can’t perform that action at this time.
0 commit comments