]> git.lizzy.rs Git - rust.git/blob - src/test/ui/custom-test-frameworks-simple.rs
Merge pull request #16 from ian-h-chamberlain/feature/target-thread-local
[rust.git] / src / test / ui / custom-test-frameworks-simple.rs
1 // compile-flags: --test
2 // run-pass
3
4 #![feature(custom_test_frameworks)]
5 #![test_runner(crate::foo_runner)]
6
7 #[cfg(test)]
8 fn foo_runner(ts: &[&dyn Fn(usize)->()]) {
9     for (i, t) in ts.iter().enumerate() {
10         t(i);
11     }
12 }
13
14 #[test_case]
15 fn test1(i: usize) {
16     println!("Hi #{}", i);
17 }
18
19 #[test_case]
20 fn test2(i: usize) {
21     println!("Hey #{}", i);
22 }