Only keep "useful" code in tests/rustdoc-ui/2024-doctests-checks.rs

This commit is contained in:
Guillaume Gomez 2024-07-11 23:37:55 +02:00
parent 7dcb841de0
commit 903d2db4d2
2 changed files with 8 additions and 24 deletions

View File

@ -4,26 +4,12 @@
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
//@ normalize-stdout-test ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
/// This one should fail: crate attributes should remain crate attributes
/// in standalone doctests.
///
/// ```compile_fail
/// #![deny(missing_docs)]
///
/// pub struct Bar;
/// ```
///
/// This one should not impact the other merged doctests.
///
/// ```
/// #![deny(unused)]
/// ```
///
/// ```
/// let x = 12;
/// ```
///
/// This one should not be a merged doctest (because of `$crate`):
/// This one should not be a merged doctest (because of `$crate`). The output
/// will confirm it by displaying both merged and standalone doctest passes.
///
/// ```
/// macro_rules! bla {

View File

@ -1,14 +1,12 @@
running 2 tests
test $DIR/2024-doctests-checks.rs - Foo (line 18) ... ok
test $DIR/2024-doctests-checks.rs - Foo (line 22) ... ok
running 1 test
test $DIR/2024-doctests-checks.rs - Foo (line 7) ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
running 2 tests
test $DIR/2024-doctests-checks.rs - Foo (line 10) - compile fail ... ok
test $DIR/2024-doctests-checks.rs - Foo (line 28) ... ok
running 1 test
test $DIR/2024-doctests-checks.rs - Foo (line 14) ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME