diff options
| author | Nixon Enraght-Moony <nixon.emoony@gmail.com> | 2022-07-18 16:59:11 +0100 |
|---|---|---|
| committer | Nixon Enraght-Moony <nixon.emoony@gmail.com> | 2022-07-18 16:59:11 +0100 |
| commit | dacffd22a0a6803fb38e2c50cbbd726d52c94ad3 (patch) | |
| tree | af344810fa788f9465bc5d328c1ab6288a0ef989 /src/test/rustdoc-json | |
| parent | 9ed0bf9f2bd63933785fb8a380c177d2d70e88ec (diff) | |
| download | rust-dacffd22a0a6803fb38e2c50cbbd726d52c94ad3.tar.gz rust-dacffd22a0a6803fb38e2c50cbbd726d52c94ad3.zip | |
Rustdoc-Json: Clean up tests
Diffstat (limited to 'src/test/rustdoc-json')
| -rw-r--r-- | src/test/rustdoc-json/reexport/glob_extern.rs | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-json/reexport/private_twice_one_inline.rs | 4 | ||||
| -rw-r--r-- | src/test/rustdoc-json/reexport/private_two_names.rs | 14 |
3 files changed, 18 insertions, 8 deletions
diff --git a/src/test/rustdoc-json/reexport/glob_extern.rs b/src/test/rustdoc-json/reexport/glob_extern.rs index ba1cfd8a0b5..83171167744 100644 --- a/src/test/rustdoc-json/reexport/glob_extern.rs +++ b/src/test/rustdoc-json/reexport/glob_extern.rs @@ -4,15 +4,19 @@ #![feature(no_core)] // @is glob_extern.json "$.index[*][?(@.name=='mod1')].kind" \"module\" -// @is glob_extern.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true" +// @is - "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true" mod mod1 { extern "C" { - // @has - "$.index[*][?(@.name=='public_fn')].id" + // @set public_fn_id = - "$.index[*][?(@.name=='public_fn')].id" pub fn public_fn(); // @!has - "$.index[*][?(@.name=='private_fn')]" fn private_fn(); } + // @count - "$.index[*][?(@.name=='mod1')].inner.items[*]" 1 + // @has - "$.index[*][?(@.name=='mod1')].inner.items[*]" $public_fn_id + // @set mod1_id = - "$.index[*][?(@.name=='mod1')].id" } // @is - "$.index[*][?(@.kind=='import')].inner.glob" true +// @is - "$.index[*][?(@.kind=='import')].inner.id" $mod1_id pub use mod1::*; diff --git a/src/test/rustdoc-json/reexport/private_twice_one_inline.rs b/src/test/rustdoc-json/reexport/private_twice_one_inline.rs index 327b0f45fdd..0340ea83a8e 100644 --- a/src/test/rustdoc-json/reexport/private_twice_one_inline.rs +++ b/src/test/rustdoc-json/reexport/private_twice_one_inline.rs @@ -1,7 +1,7 @@ // aux-build:pub-struct.rs -// Test for the ICE in rust/83057 -// Am external type re-exported with different attributes shouldn't cause an error +// Test for the ICE in https://github.com/rust-lang/rust/issues/83057 +// An external type re-exported with different attributes shouldn't cause an error #![no_core] #![feature(no_core)] diff --git a/src/test/rustdoc-json/reexport/private_two_names.rs b/src/test/rustdoc-json/reexport/private_two_names.rs index 36d6a50d385..f975895c4d9 100644 --- a/src/test/rustdoc-json/reexport/private_two_names.rs +++ b/src/test/rustdoc-json/reexport/private_two_names.rs @@ -1,4 +1,4 @@ -// Test for the ICE in rust/83720 +// Test for the ICE in https://github.com/rust-lang/rust/issues/83720 // A pub-in-private type re-exported under two different names shouldn't cause an error #![no_core] @@ -7,11 +7,17 @@ // @is private_two_names.json "$.index[*][?(@.name=='style')].kind" \"module\" // @is private_two_names.json "$.index[*][?(@.name=='style')].inner.is_stripped" "true" mod style { - // @has - "$.index[*](?(@.name=='Color'))" + // @set color_struct_id = - "$.index[*][?(@.kind=='struct' && @.name=='Color')].id" pub struct Color; } -// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')]" +// @is - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].inner.id" $color_struct_id +// @set color_export_id = - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].id" pub use style::Color; -// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')]" +// @is - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].inner.id" $color_struct_id +// @set colour_export_id = - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].id" pub use style::Color as Colour; + +// @count - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" 2 +// @has - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" $color_export_id +// @has - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" $colour_export_id |
