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 Aug 18, 2020
1 parent d9d84dc commit f957bae
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 51 deletions.
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/basic.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% |
+-------------------------------------+------------+------------+------------+
| Total | 7 | 14 | 50.0% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 7 | 14 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
27 changes: 27 additions & 0 deletions src/test/rustdoc-ui/coverage/doc-examples.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// compile-flags:-Z unstable-options --show-coverage
// check-pass

//! This test ensure that only rust code examples are counted.

/// Doc
///
/// ```
/// let x = 2;
/// ```
pub struct Foo;

/// Doc
///
/// ```text
/// yolo
/// ```
pub trait Bar {}

/// Doc
///
/// ```ignore (just for the sake of this test)
/// let x = 2;
/// ```
pub fn foo<T: Bar, D: ::std::fmt::Debug>(a: Foo, b: u32, c: T, d: D) -> u32 {
0
}
7 changes: 7 additions & 0 deletions src/test/rustdoc-ui/coverage/doc-examples.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...tdoc-ui/coverage/doc-examples.rs | 4 | 4 | 100.0% | 2 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 4 | 4 | 100.0% | 2 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/empty.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% |
+-------------------------------------+------------+------------+------------+
| Total | 0 | 1 | 0.0% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 0 | 1 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/enums.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% |
+-------------------------------------+------------+------------+------------+
| Total | 6 | 8 | 75.0% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 8 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
16 changes: 8 additions & 8 deletions src/test/rustdoc-ui/coverage/exotic.stdout
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% |
| <anon> | 2 | 2 | 100.0% |
+-------------------------------------+------------+------------+------------+
| Total | 3 | 3 | 100.0% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% | 0 | 0.0% |
| <anon> | 2 | 2 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 3 | 3 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/coverage/json.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$DIR/json.rs":{"total":13,"with_docs":7}}
{"$DIR/json.rs":{"total":13,"with_docs":7,"with_examples":0}}
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/private.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% |
+-------------------------------------+------------+------------+------------+
| Total | 4 | 7 | 57.1% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 4 | 7 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/statics-consts.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% |
+-------------------------------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
14 changes: 7 additions & 7 deletions src/test/rustdoc-ui/coverage/traits.stdout
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+
| File | Documented | Total | Percentage |
+-------------------------------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% |
+-------------------------------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% |
+-------------------------------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+

0 comments on commit f957bae

Please sign in to comment.