forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#82311 - aDotInTheVoid:jsondocck-improvement…
…s, r=jyn514 Jsondocck improvements Adds 2 new commands, ``@is`` and ``@set`.` ``@is`` works like ``@has`,` except instead of checking if any value matches, it checks that there is exactly one value, and it matches. This allows more precise testing. ``@set`` gets a value, and saves it to be used later. This makes it possible to check that an item appears in the correct module. Once this lands, the rest of the test suite can be upgraded to use these. cc `@CraftSpider` `@rustbot` modify labels: +T-rustdoc +A-rustdoc-json +A-testsuite
- Loading branch information
Showing
3 changed files
with
70 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
// edition:2018 | ||
|
||
// @has nested.json "$.index[*][?(@.name=='nested')].kind" \"module\" | ||
// @has - "$.index[*][?(@.name=='nested')].inner.is_crate" true | ||
// @is nested.json "$.index[*][?(@.name=='nested')].kind" \"module\" | ||
// @is - "$.index[*][?(@.name=='nested')].inner.is_crate" true | ||
// @count - "$.index[*][?(@.name=='nested')].inner.items[*]" 1 | ||
|
||
// @has nested.json "$.index[*][?(@.name=='l1')].kind" \"module\" | ||
// @has - "$.index[*][?(@.name=='l1')].inner.is_crate" false | ||
// @is nested.json "$.index[*][?(@.name=='l1')].kind" \"module\" | ||
// @is - "$.index[*][?(@.name=='l1')].inner.is_crate" false | ||
// @count - "$.index[*][?(@.name=='l1')].inner.items[*]" 2 | ||
pub mod l1 { | ||
|
||
// @has nested.json "$.index[*][?(@.name=='l3')].kind" \"module\" | ||
// @has - "$.index[*][?(@.name=='l3')].inner.is_crate" false | ||
// @is nested.json "$.index[*][?(@.name=='l3')].kind" \"module\" | ||
// @is - "$.index[*][?(@.name=='l3')].inner.is_crate" false | ||
// @count - "$.index[*][?(@.name=='l3')].inner.items[*]" 1 | ||
// @set l3_id = - "$.index[*][?(@.name=='l3')].id" | ||
// @has - "$.index[*][?(@.name=='l1')].inner.items[*]" $l3_id | ||
pub mod l3 { | ||
|
||
// @has nested.json "$.index[*][?(@.name=='L4')].kind" \"struct\" | ||
// @has - "$.index[*][?(@.name=='L4')].inner.struct_type" \"unit\" | ||
// @is nested.json "$.index[*][?(@.name=='L4')].kind" \"struct\" | ||
// @is - "$.index[*][?(@.name=='L4')].inner.struct_type" \"unit\" | ||
// @set l4_id = - "$.index[*][?(@.name=='L4')].id" | ||
// @has - "$.index[*][?(@.name=='l3')].inner.items[*]" $l4_id | ||
pub struct L4; | ||
} | ||
// @has nested.json "$.index[*][?(@.inner.span=='l3::L4')].kind" \"import\" | ||
// @has - "$.index[*][?(@.inner.span=='l3::L4')].inner.glob" false | ||
// @is nested.json "$.index[*][?(@.inner.span=='l3::L4')].kind" \"import\" | ||
// @is - "$.index[*][?(@.inner.span=='l3::L4')].inner.glob" false | ||
pub use l3::L4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters