diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-05 17:03:55 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-05 17:03:55 +0000 |
commit | cc53e9e7d17871c03fa9d88c709873e20690ca84 (patch) | |
tree | 9021f6b236ce24d19a7a419c9f8c9c08c9ff08f4 /crates/ra_analysis/tests/test | |
parent | 2a19d699eb594c4929215a24df333f87fd41881a (diff) | |
parent | ee461a211195b093269ead477f01fcf63f20cf34 (diff) |
Merge #437
437: refactor goto defenition r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/tests/test')
-rw-r--r-- | crates/ra_analysis/tests/test/main.rs | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/crates/ra_analysis/tests/test/main.rs b/crates/ra_analysis/tests/test/main.rs index beeae1e19..e15035304 100644 --- a/crates/ra_analysis/tests/test/main.rs +++ b/crates/ra_analysis/tests/test/main.rs | |||
@@ -15,65 +15,6 @@ fn get_signature(text: &str) -> (FnSignatureInfo, Option<usize>) { | |||
15 | } | 15 | } |
16 | 16 | ||
17 | #[test] | 17 | #[test] |
18 | fn approximate_resolve_works_in_items() { | ||
19 | let (analysis, pos) = analysis_and_position( | ||
20 | " | ||
21 | //- /lib.rs | ||
22 | struct Foo; | ||
23 | enum E { X(Foo<|>) } | ||
24 | ", | ||
25 | ); | ||
26 | |||
27 | let symbols = analysis.approximately_resolve_symbol(pos).unwrap().unwrap(); | ||
28 | assert_eq_dbg( | ||
29 | r#"ReferenceResolution { | ||
30 | reference_range: [23; 26), | ||
31 | resolves_to: [NavigationTarget { file_id: FileId(1), name: "Foo", kind: STRUCT_DEF, range: [0; 11), ptr: Some(LocalSyntaxPtr { range: [0; 11), kind: STRUCT_DEF }) }] | ||
32 | }"#, | ||
33 | &symbols, | ||
34 | ); | ||
35 | } | ||
36 | |||
37 | #[test] | ||
38 | fn test_resolve_module() { | ||
39 | let (analysis, pos) = analysis_and_position( | ||
40 | " | ||
41 | //- /lib.rs | ||
42 | mod <|>foo; | ||
43 | //- /foo.rs | ||
44 | // empty | ||
45 | ", | ||
46 | ); | ||
47 | |||
48 | let symbols = analysis.approximately_resolve_symbol(pos).unwrap().unwrap(); | ||
49 | assert_eq_dbg( | ||
50 | r#"ReferenceResolution { | ||
51 | reference_range: [4; 7), | ||
52 | resolves_to: [NavigationTarget { file_id: FileId(2), name: "foo", kind: MODULE, range: [0; 0), ptr: None }] | ||
53 | }"#, | ||
54 | &symbols, | ||
55 | ); | ||
56 | |||
57 | let (analysis, pos) = analysis_and_position( | ||
58 | " | ||
59 | //- /lib.rs | ||
60 | mod <|>foo; | ||
61 | //- /foo/mod.rs | ||
62 | // empty | ||
63 | ", | ||
64 | ); | ||
65 | |||
66 | let symbols = analysis.approximately_resolve_symbol(pos).unwrap().unwrap(); | ||
67 | assert_eq_dbg( | ||
68 | r#"ReferenceResolution { | ||
69 | reference_range: [4; 7), | ||
70 | resolves_to: [NavigationTarget { file_id: FileId(2), name: "foo", kind: MODULE, range: [0; 0), ptr: None }] | ||
71 | }"#, | ||
72 | &symbols, | ||
73 | ); | ||
74 | } | ||
75 | |||
76 | #[test] | ||
77 | fn test_unresolved_module_diagnostic() { | 18 | fn test_unresolved_module_diagnostic() { |
78 | let (analysis, file_id) = single_file("mod foo;"); | 19 | let (analysis, file_id) = single_file("mod foo;"); |
79 | let diagnostics = analysis.diagnostics(file_id).unwrap(); | 20 | let diagnostics = analysis.diagnostics(file_id).unwrap(); |