about summary refs log tree commit diff
path: root/tests/rustdoc-ui/run-as-standalone.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-ui/run-as-standalone.rs')
-rw-r--r--tests/rustdoc-ui/run-as-standalone.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc-ui/run-as-standalone.rs b/tests/rustdoc-ui/run-as-standalone.rs
new file mode 100644
index 00000000000..a0fb0340f8d
--- /dev/null
+++ b/tests/rustdoc-ui/run-as-standalone.rs
@@ -0,0 +1,17 @@
+// This test ensures that if there is only one mergeable doctest, then it is
+// instead run as part of standalone doctests.
+
+//@ compile-flags:--test --test-args=--test-threads=1 -Zunstable-options --edition 2024
+//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
+//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+//@ normalize-stdout-test ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
+//@ check-pass
+
+/// ```
+/// let x = 12;
+/// ```
+///
+/// ```compile_fail
+/// let y = x;
+/// ```
+pub fn one() {}