about summary refs log tree commit diff
path: root/tests/ui/custom-test-frameworks-simple.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/custom-test-frameworks-simple.rs')
-rw-r--r--tests/ui/custom-test-frameworks-simple.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/custom-test-frameworks-simple.rs b/tests/ui/custom-test-frameworks-simple.rs
new file mode 100644
index 00000000000..aee0040ef4d
--- /dev/null
+++ b/tests/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);
+}