Add ui test for new rustdoc --output-format=doctest
option
This commit is contained in:
parent
0323af93b4
commit
7fa2094cb1
2 changed files with 16 additions and 0 deletions
15
tests/rustdoc-ui/extract-doctests.rs
Normal file
15
tests/rustdoc-ui/extract-doctests.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Test to ensure that it generates expected output for `--output-format=doctest` command-line
|
||||
// flag.
|
||||
|
||||
//@ compile-flags:-Z unstable-options --output-format=doctest
|
||||
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
|
||||
//@ check-pass
|
||||
|
||||
//! ```ignore (checking attributes)
|
||||
//! let x = 12;
|
||||
//! let y = 14;
|
||||
//! ```
|
||||
//!
|
||||
//! ```edition2018,compile_fail
|
||||
//! let
|
||||
//! ```
|
1
tests/rustdoc-ui/extract-doctests.stdout
Normal file
1
tests/rustdoc-ui/extract-doctests.stdout
Normal file
|
@ -0,0 +1 @@
|
|||
[{"doctest_code":"#![allow(unused)]\nfn main() {\nlet x = 12;\nlet y = 14;\n}","filename":"$DIR/extract-doctests.rs","line":8,"doctest_attributes":{"original":"ignore (checking attributes)","should_panic":false,"no_run":false,"ignore":"All","rust":true,"test_harness":false,"compile_fail":false,"standalone_crate":false,"error_codes":[],"edition":null,"added_classes":[],"unknown":[]},"original_code":"let x = 12;\nlet y = 14;","name":"$DIR/extract-doctests.rs - (line 8)"},{"doctest_code":"#![allow(unused)]\nfn main() {\nlet\n}","filename":"$DIR/extract-doctests.rs","line":13,"doctest_attributes":{"original":"edition2018,compile_fail","should_panic":false,"no_run":true,"ignore":"None","rust":true,"test_harness":false,"compile_fail":true,"standalone_crate":false,"error_codes":[],"edition":"2018","added_classes":[],"unknown":[]},"original_code":"let","name":"$DIR/extract-doctests.rs - (line 13)"}]
|
Loading…
Add table
Add a link
Reference in a new issue