diff options
author | Aleksey Kladov <[email protected]> | 2019-05-30 13:14:11 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-30 13:14:11 +0100 |
commit | c6ee9d681c7c745e95f19badef271fec34ec2e36 (patch) | |
tree | ed0511c6c0927b14ea39bf9f34032260b588b2d4 /crates/ra_hir/src/nameres | |
parent | 97158f5c8a6dadf3bcf28601f739ab6b7c4464aa (diff) |
add tests for primitive types
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/tests.rs | 1 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/tests/primitives.rs | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index ffb627c02..a15e62bbe 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | mod macros; | 1 | mod macros; |
2 | mod globs; | 2 | mod globs; |
3 | mod incremental; | 3 | mod incremental; |
4 | mod primitives; | ||
4 | 5 | ||
5 | use std::sync::Arc; | 6 | use std::sync::Arc; |
6 | 7 | ||
diff --git a/crates/ra_hir/src/nameres/tests/primitives.rs b/crates/ra_hir/src/nameres/tests/primitives.rs new file mode 100644 index 000000000..734744835 --- /dev/null +++ b/crates/ra_hir/src/nameres/tests/primitives.rs | |||
@@ -0,0 +1,24 @@ | |||
1 | use super::*; | ||
2 | |||
3 | #[test] | ||
4 | fn primitive_reexport() { | ||
5 | let map = def_map( | ||
6 | " | ||
7 | //- /lib.rs | ||
8 | mod foo; | ||
9 | use foo::int; | ||
10 | |||
11 | //- /foo.rs | ||
12 | pub use i32 as int; | ||
13 | ", | ||
14 | ); | ||
15 | assert_snapshot_matches!(map, @r###" | ||
16 | ⋮crate | ||
17 | ⋮foo: t | ||
18 | ⋮int: t | ||
19 | ⋮ | ||
20 | ⋮crate::foo | ||
21 | ⋮int: t | ||
22 | "### | ||
23 | ); | ||
24 | } | ||