diff options
author | Benjamin Coenen <[email protected]> | 2020-05-10 11:31:55 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-05-10 11:31:55 +0100 |
commit | e80903a96564c2239489a8c630a4748bf21a3659 (patch) | |
tree | 12b31a1fd12deb2120065cea5a558425c8c1984f /crates/ra_hir_ty/src/tests/display_source_code.rs | |
parent | 6203e9c4faee288f16d93dbb7dd0f1f8df487d83 (diff) | |
parent | 4578154b608fa075595103d0c933da60d55b25c8 (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into feat_4348
Diffstat (limited to 'crates/ra_hir_ty/src/tests/display_source_code.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/display_source_code.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/display_source_code.rs b/crates/ra_hir_ty/src/tests/display_source_code.rs new file mode 100644 index 000000000..ca1748615 --- /dev/null +++ b/crates/ra_hir_ty/src/tests/display_source_code.rs | |||
@@ -0,0 +1,23 @@ | |||
1 | use super::displayed_source_at_pos; | ||
2 | use crate::test_db::TestDB; | ||
3 | use ra_db::fixture::WithFixture; | ||
4 | |||
5 | #[test] | ||
6 | fn qualify_path_to_submodule() { | ||
7 | let (db, pos) = TestDB::with_position( | ||
8 | r#" | ||
9 | //- /main.rs | ||
10 | |||
11 | mod foo { | ||
12 | pub struct Foo; | ||
13 | } | ||
14 | |||
15 | fn bar() { | ||
16 | let foo: foo::Foo = foo::Foo; | ||
17 | foo<|> | ||
18 | } | ||
19 | |||
20 | "#, | ||
21 | ); | ||
22 | assert_eq!("foo::Foo", displayed_source_at_pos(&db, pos)); | ||
23 | } | ||