diff options
Diffstat (limited to 'crates/ra_analysis/tests')
-rw-r--r-- | crates/ra_analysis/tests/test/main.rs | 1 | ||||
-rw-r--r-- | crates/ra_analysis/tests/test/type_of.rs | 77 |
2 files changed, 0 insertions, 78 deletions
diff --git a/crates/ra_analysis/tests/test/main.rs b/crates/ra_analysis/tests/test/main.rs index e15035304..26da7c10c 100644 --- a/crates/ra_analysis/tests/test/main.rs +++ b/crates/ra_analysis/tests/test/main.rs | |||
@@ -1,5 +1,4 @@ | |||
1 | mod runnables; | 1 | mod runnables; |
2 | mod type_of; | ||
3 | 2 | ||
4 | use ra_syntax::TextRange; | 3 | use ra_syntax::TextRange; |
5 | use test_utils::{assert_eq_dbg, assert_eq_text}; | 4 | use test_utils::{assert_eq_dbg, assert_eq_text}; |
diff --git a/crates/ra_analysis/tests/test/type_of.rs b/crates/ra_analysis/tests/test/type_of.rs deleted file mode 100644 index 9d15b52a8..000000000 --- a/crates/ra_analysis/tests/test/type_of.rs +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | use ra_analysis::mock_analysis::single_file_with_range; | ||
2 | |||
3 | #[test] | ||
4 | fn test_type_of_for_function() { | ||
5 | let (analysis, range) = single_file_with_range( | ||
6 | " | ||
7 | pub fn foo() -> u32 { 1 }; | ||
8 | |||
9 | fn main() { | ||
10 | let foo_test = <|>foo()<|>; | ||
11 | } | ||
12 | ", | ||
13 | ); | ||
14 | |||
15 | let type_name = analysis.type_of(range).unwrap().unwrap(); | ||
16 | assert_eq!("u32", &type_name); | ||
17 | } | ||
18 | |||
19 | // FIXME: improve type_of to make this work | ||
20 | #[test] | ||
21 | fn test_type_of_for_num() { | ||
22 | let (analysis, range) = single_file_with_range( | ||
23 | r#" | ||
24 | fn main() { | ||
25 | let foo_test = <|>"foo"<|>; | ||
26 | } | ||
27 | "#, | ||
28 | ); | ||
29 | |||
30 | assert!(analysis.type_of(range).unwrap().is_none()); | ||
31 | } | ||
32 | // FIXME: improve type_of to make this work | ||
33 | #[test] | ||
34 | fn test_type_of_for_binding() { | ||
35 | let (analysis, range) = single_file_with_range( | ||
36 | " | ||
37 | pub fn foo() -> u32 { 1 }; | ||
38 | |||
39 | fn main() { | ||
40 | let <|>foo_test<|> = foo(); | ||
41 | } | ||
42 | ", | ||
43 | ); | ||
44 | |||
45 | assert!(analysis.type_of(range).unwrap().is_none()); | ||
46 | } | ||
47 | |||
48 | // FIXME: improve type_of to make this work | ||
49 | #[test] | ||
50 | fn test_type_of_for_expr_1() { | ||
51 | let (analysis, range) = single_file_with_range( | ||
52 | " | ||
53 | fn main() { | ||
54 | let foo = <|>1 + foo_test<|>; | ||
55 | } | ||
56 | ", | ||
57 | ); | ||
58 | |||
59 | let type_name = analysis.type_of(range).unwrap().unwrap(); | ||
60 | assert_eq!("[unknown]", &type_name); | ||
61 | } | ||
62 | |||
63 | // FIXME: improve type_of to make this work | ||
64 | #[test] | ||
65 | fn test_type_of_for_expr_2() { | ||
66 | let (analysis, range) = single_file_with_range( | ||
67 | " | ||
68 | fn main() { | ||
69 | let foo: usize = 1; | ||
70 | let bar = <|>1 + foo_test<|>; | ||
71 | } | ||
72 | ", | ||
73 | ); | ||
74 | |||
75 | let type_name = analysis.type_of(range).unwrap().unwrap(); | ||
76 | assert_eq!("[unknown]", &type_name); | ||
77 | } | ||