Skip to content

Commit dacffd2

Browse files
committed
Rustdoc-Json: Clean up tests
1 parent 9ed0bf9 commit dacffd2

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/test/rustdoc-json/reexport/glob_extern.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44
#![feature(no_core)]
55

66
// @is glob_extern.json "$.index[*][?(@.name=='mod1')].kind" \"module\"
7-
// @is glob_extern.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
7+
// @is - "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
88
mod mod1 {
99
extern "C" {
10-
// @has - "$.index[*][?(@.name=='public_fn')].id"
10+
// @set public_fn_id = - "$.index[*][?(@.name=='public_fn')].id"
1111
pub fn public_fn();
1212
// @!has - "$.index[*][?(@.name=='private_fn')]"
1313
fn private_fn();
1414
}
15+
// @count - "$.index[*][?(@.name=='mod1')].inner.items[*]" 1
16+
// @has - "$.index[*][?(@.name=='mod1')].inner.items[*]" $public_fn_id
17+
// @set mod1_id = - "$.index[*][?(@.name=='mod1')].id"
1518
}
1619

1720
// @is - "$.index[*][?(@.kind=='import')].inner.glob" true
21+
// @is - "$.index[*][?(@.kind=='import')].inner.id" $mod1_id
1822
pub use mod1::*;

src/test/rustdoc-json/reexport/private_twice_one_inline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// aux-build:pub-struct.rs
22

3-
// Test for the ICE in rust/83057
4-
// Am external type re-exported with different attributes shouldn't cause an error
3+
// Test for the ICE in https://github.com/rust-lang/rust/issues/83057
4+
// An external type re-exported with different attributes shouldn't cause an error
55

66
#![no_core]
77
#![feature(no_core)]
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Test for the ICE in rust/83720
1+
// Test for the ICE in https://github.com/rust-lang/rust/issues/83720
22
// A pub-in-private type re-exported under two different names shouldn't cause an error
33

44
#![no_core]
@@ -7,11 +7,17 @@
77
// @is private_two_names.json "$.index[*][?(@.name=='style')].kind" \"module\"
88
// @is private_two_names.json "$.index[*][?(@.name=='style')].inner.is_stripped" "true"
99
mod style {
10-
// @has - "$.index[*](?(@.name=='Color'))"
10+
// @set color_struct_id = - "$.index[*][?(@.kind=='struct' && @.name=='Color')].id"
1111
pub struct Color;
1212
}
1313

14-
// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')]"
14+
// @is - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].inner.id" $color_struct_id
15+
// @set color_export_id = - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].id"
1516
pub use style::Color;
16-
// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')]"
17+
// @is - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].inner.id" $color_struct_id
18+
// @set colour_export_id = - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].id"
1719
pub use style::Color as Colour;
20+
21+
// @count - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" 2
22+
// @has - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" $color_export_id
23+
// @has - "$.index[*][?(@.name=='private_two_names')].inner.items[*]" $colour_export_id

0 commit comments

Comments
 (0)