about summary refs log tree commit diff
path: root/tests/ui/test-attrs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-06-07 16:17:21 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-06-08 11:25:09 +0500
commit85ce9ee481a56bcabaa9480cfc0e2b420e4f1807 (patch)
tree546842f643a74977c32a405980899c37e7737def /tests/ui/test-attrs
parentc57119b9a1c86968188bb9703a7859c17f8bc71c (diff)
downloadrust-85ce9ee481a56bcabaa9480cfc0e2b420e4f1807.tar.gz
rust-85ce9ee481a56bcabaa9480cfc0e2b420e4f1807.zip
cleaned up some tests
Diffstat (limited to 'tests/ui/test-attrs')
-rw-r--r--tests/ui/test-attrs/custom_test_frameworks_simple.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/test-attrs/custom_test_frameworks_simple.rs b/tests/ui/test-attrs/custom_test_frameworks_simple.rs
new file mode 100644
index 00000000000..54a4e4095a7
--- /dev/null
+++ b/tests/ui/test-attrs/custom_test_frameworks_simple.rs
@@ -0,0 +1,24 @@
+//! Checks run with a custom test framework and indexed test functions.
+
+//@ 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);
+}