1 // compile-flags: --test 2 // run-pass 3 4 #![feature(custom_test_frameworks)] 5 #![test_runner(crate::foo_runner)] 6 7 #[cfg(test)] foo_runner(ts: &[&dyn Fn(usize)->()])8fn foo_runner(ts: &[&dyn Fn(usize)->()]) { 9 for (i, t) in ts.iter().enumerate() { 10 t(i); 11 } 12 } 13 14 #[test_case] test1(i: usize)15fn test1(i: usize) { 16 println!("Hi #{}", i); 17 } 18 19 #[test_case] test2(i: usize)20fn test2(i: usize) { 21 println!("Hey #{}", i); 22 } 23