Skip to content

Commit

Permalink
Update rustdoc-ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 18, 2019
1 parent b5d4bd2 commit c78af2b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/test/rustdoc-ui/doc-without-codeblock.rs
@@ -1,6 +1,4 @@
//~ ERROR Missing code example in this documentation

#![deny(missing_doc_code_examples)]
#![deny(missing_doc_code_examples)] //~ ERROR Missing code example in this documentation

/// Some docs.
//~^ ERROR Missing code example in this documentation
Expand Down
18 changes: 14 additions & 4 deletions src/test/rustdoc-ui/doc-without-codeblock.stderr
@@ -1,25 +1,35 @@
error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:1:1
|
LL | / #![deny(missing_doc_code_examples)]
LL | |
LL | | /// Some docs.
LL | |
... |
LL | | pub fn bar() {}
LL | | }
| |_^
|
note: lint level defined here
--> $DIR/doc-without-codeblock.rs:3:9
--> $DIR/doc-without-codeblock.rs:1:9
|
LL | #![deny(missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:5:1
--> $DIR/doc-without-codeblock.rs:3:1
|
LL | /// Some docs.
| ^^^^^^^^^^^^^^

error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:9:1
--> $DIR/doc-without-codeblock.rs:7:1
|
LL | /// And then, the princess died.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: Missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:12:5
--> $DIR/doc-without-codeblock.rs:10:5
|
LL | /// Or maybe not because she saved herself!
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion src/test/rustdoc-ui/lint-missing-doc-code-example.rs
Expand Up @@ -16,7 +16,7 @@ fn test() {
}

#[allow(missing_docs)]
mod module1 {
mod module1 { //~ ERROR
}

#[allow(missing_doc_code_examples)]
Expand All @@ -35,5 +35,6 @@ mod module2 {
pub mod module3 {

/// doc
//~^ ERROR
pub fn test() {}
}
21 changes: 21 additions & 0 deletions src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
@@ -0,0 +1,21 @@
error: Missing code example in this documentation
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
LL | / mod module1 {
LL | | }
| |_^
|
note: lint level defined here
--> $DIR/lint-missing-doc-code-example.rs:2:9
|
LL | #![deny(missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^

error: Missing code example in this documentation
--> $DIR/lint-missing-doc-code-example.rs:37:3
|
LL | /// doc
| ^^^^^^^

error: aborting due to 2 previous errors

0 comments on commit c78af2b

Please sign in to comment.