Skip to content

Commit bc539de

Browse files
committed
Add reexport tests
1 parent cecdb18 commit bc539de

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
mod mod1 {
6+
extern "C" {
7+
pub fn public_fn();
8+
fn private_fn();
9+
}
10+
}
11+
12+
pub use mod1::*;
13+
14+
// @!has glob_extern.json "$.index[*][?(@.name=='mod1')]"
15+
// @!has - "$.index[*][?(@.name=='private_fn')]"
16+
// @set public_fn_id = - "$.index[*][?(@.name=='public_fn')].id"
17+
// @has - "$.index[*][?(@.name=='glob_extern')].inner.items[*]" $public_fn_id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
mod mod1 {
7+
mod mod2 {
8+
pub struct Mod2Public;
9+
struct Mod2Private;
10+
}
11+
pub use self::mod2::*;
12+
13+
pub struct Mod1Public;
14+
struct Mod1Private;
15+
}
16+
pub use mod1::*;
17+
18+
// @set m2pub_id = glob_private.json "$.index[*][?(@.name=='Mod2Public')].id"
19+
// @set m1pub_id = - "$.index[*][?(@.name=='Mod1Public')].id"
20+
// @has - "$.index[*][?(@.name=='glob_private')].inner.items[*]" $m2pub_id
21+
// @has - "$.index[*][?(@.name=='glob_private')].inner.items[*]" $m1pub_id
22+
// @!has - "$.index[*][?(@.name=='mod1')]"
23+
// @!has - "$.index[*][?(@.name=='mod2')]"
24+
// @!has - "$.index[*][?(@.name=='Mod1Private')]"
25+
// @!has - "$.index[*][?(@.name=='Mod2Private')]"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @set inner_id = rename_public.json "$.index[*][?(@.name=='inner')].id"
7+
// @has - "$.index[*][?(@.name=='rename_public')].inner.items[*]" $inner_id
8+
pub mod inner {
9+
// @set public_id = - "$.index[*][?(@.name=='Public')].id"
10+
// @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
11+
pub struct Public;
12+
}
13+
// @set import_id = - "$.index[*][?(@.inner.name=='NewName')].id"
14+
// @has - "$.index[*][?(@.name=='rename_public')].inner.items[*]" $import_id
15+
// @is - "$.index[*][?(@.inner.name=='NewName')].inner.span" \"inner::Public\"
16+
pub use inner::Public as NewName;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @!has simple_private.json "$.index[*][?(@.name=='inner')]"
7+
// @set pub_id = - "$.index[*][?(@.name=='Public')].id"
8+
// @has - "$.index[*][?(@.name=='simple_private')].inner.items[*]" $pub_id
9+
10+
mod inner {
11+
pub struct Public;
12+
}
13+
pub use inner::Public;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @set inner_id = simple_public.json "$.index[*][?(@.name=='inner')].id"
7+
// @has - "$.index[*][?(@.name=='simple_public')].inner.items[*]" $inner_id
8+
pub mod inner {
9+
10+
// @set public_id = - "$.index[*][?(@.name=='Public')].id"
11+
// @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
12+
pub struct Public;
13+
}
14+
15+
// @set import_id = - "$.index[*][?(@.inner.name=='Public')].id"
16+
// @has - "$.index[*][?(@.name=='simple_public')].inner.items[*]" $import_id
17+
// @is - "$.index[*][?(@.inner.name=='Public')].inner.span" \"inner::Public\"
18+
pub use inner::Public;

0 commit comments

Comments
 (0)