aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/tests/test/type_of.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/tests/test/type_of.rs')
-rw-r--r--crates/ra_analysis/tests/test/type_of.rs77
1 files changed, 0 insertions, 77 deletions
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 @@
1use ra_analysis::mock_analysis::single_file_with_range;
2
3#[test]
4fn 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]
21fn 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]
34fn 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]
50fn 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]
65fn 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}