1
Fork 0

Add test to ensure passing --doctest_compilation_args multiple times work

This commit is contained in:
Guillaume Gomez 2024-12-20 15:39:26 +01:00
parent bc03e40a29
commit 2d914bed2d
3 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,17 @@
// This test checks that the test behave when `--doctest-compilation-args` is passed
// multiple times.
//@ check-pass
//@ compile-flags: --test -Zunstable-options --doctest-compilation-args=--cfg=testcase_must_be_present
//@ compile-flags: --doctest-compilation-args=--cfg=another
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
/// ```
/// #[cfg(testcase_must_be_present)]
/// #[cfg(another)]
/// fn must_be_present() {}
///
/// fn main() { must_be_present() }
/// ```
pub struct Bar;