Skip to content

Commit

Permalink
Add UI test for --extra-doctests command-line flag
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 20, 2024
1 parent 5afc1c5 commit 5adedd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/rustdoc-ui/extract-doctests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Test to ensure that it generates expected output for `--extract-doctests` command-line
// flag.

//@ compile-flags:-Z unstable-options --extract-doctests
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
//@ check-pass

//! ```ignore (checking attributes)
//! let x = 12;
//! let y = 14;
//! ```
//!
//! ```edition2018,compile_fail
//! let
//! ```
1 change: 1 addition & 0 deletions tests/rustdoc-ui/extract-doctests.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"filename":"$DIR/extract-doctests.rs","line":8,"langstr":{"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":[]},"text":"let x = 12;\nlet y = 14;"},{"filename":"$DIR/extract-doctests.rs","line":13,"langstr":{"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":[]},"text":"let"}]

0 comments on commit 5adedd7

Please sign in to comment.