From 97158f5c8a6dadf3bcf28601f739ab6b7c4464aa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 May 2019 15:03:58 +0300 Subject: add built-in types to scopes --- crates/ra_hir/src/nameres/tests/incremental.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/nameres/tests') diff --git a/crates/ra_hir/src/nameres/tests/incremental.rs b/crates/ra_hir/src/nameres/tests/incremental.rs index 001f76ac3..bc721f6e0 100644 --- a/crates/ra_hir/src/nameres/tests/incremental.rs +++ b/crates/ra_hir/src/nameres/tests/incremental.rs @@ -116,7 +116,7 @@ fn typing_inside_a_macro_should_not_invalidate_def_map() { let events = db.log_executed(|| { let module = crate::source_binder::module_from_file_id(&db, pos.file_id).unwrap(); let decls = module.declarations(&db); - assert_eq!(decls.len(), 1); + assert_eq!(decls.len(), 18); }); assert!(format!("{:?}", events).contains("crate_def_map"), "{:#?}", events) } @@ -126,7 +126,7 @@ fn typing_inside_a_macro_should_not_invalidate_def_map() { let events = db.log_executed(|| { let module = crate::source_binder::module_from_file_id(&db, pos.file_id).unwrap(); let decls = module.declarations(&db); - assert_eq!(decls.len(), 1); + assert_eq!(decls.len(), 18); }); assert!(!format!("{:?}", events).contains("crate_def_map"), "{:#?}", events) } -- cgit v1.2.3 From c6ee9d681c7c745e95f19badef271fec34ec2e36 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 May 2019 15:14:11 +0300 Subject: add tests for primitive types --- crates/ra_hir/src/nameres/tests/primitives.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 crates/ra_hir/src/nameres/tests/primitives.rs (limited to 'crates/ra_hir/src/nameres/tests') 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 @@ +use super::*; + +#[test] +fn primitive_reexport() { + let map = def_map( + " + //- /lib.rs + mod foo; + use foo::int; + + //- /foo.rs + pub use i32 as int; + ", + ); + assert_snapshot_matches!(map, @r###" + ⋮crate + ⋮foo: t + ⋮int: t + ⋮ + ⋮crate::foo + ⋮int: t + "### + ); +} -- cgit v1.2.3