summaryrefslogtreecommitdiffstats
path: root/src/test/ui/custom-test-frameworks-simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/custom-test-frameworks-simple.rs')
-rw-r--r--src/test/ui/custom-test-frameworks-simple.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/custom-test-frameworks-simple.rs b/src/test/ui/custom-test-frameworks-simple.rs
new file mode 100644
index 000000000..aee0040ef
--- /dev/null
+++ b/src/test/ui/custom-test-frameworks-simple.rs
@@ -0,0 +1,22 @@
+// compile-flags: --test
+// run-pass
+
+#![feature(custom_test_frameworks)]
+#![test_runner(crate::foo_runner)]
+
+#[cfg(test)]
+fn foo_runner(ts: &[&dyn Fn(usize)->()]) {
+ for (i, t) in ts.iter().enumerate() {
+ t(i);
+ }
+}
+
+#[test_case]
+fn test1(i: usize) {
+ println!("Hi #{}", i);
+}
+
+#[test_case]
+fn test2(i: usize) {
+ println!("Hey #{}", i);
+}