diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-14 18:30:21 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-14 18:30:21 +0000 |
commit | a9a6a50c759302e8a8d59bf6c53c72ec804324b3 (patch) | |
tree | ecd22d01bca8bfb2419732621140c3271277973d /crates/ra_hir/src/ty | |
parent | 606d66a714bb8fe07f35a6af83d04ab576b9a0e1 (diff) |
Fixup tests
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests/data/binary_op.txt | 86 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests/data/literals.txt | 3 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests/data/tuple.txt | 18 |
4 files changed, 56 insertions, 56 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 53ea99874..cbdb2a4b7 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -145,6 +145,7 @@ fn test() { | |||
145 | 3.14; | 145 | 3.14; |
146 | 5000; | 146 | 5000; |
147 | false; | 147 | false; |
148 | true; | ||
148 | } | 149 | } |
149 | "#, | 150 | "#, |
150 | "literals.txt", | 151 | "literals.txt", |
@@ -199,7 +200,7 @@ fn f(x: bool) -> i32 { | |||
199 | 0i32 | 200 | 0i32 |
200 | } | 201 | } |
201 | 202 | ||
202 | fn test() { | 203 | fn test() -> bool { |
203 | let x = a && b; | 204 | let x = a && b; |
204 | let y = true || false; | 205 | let y = true || false; |
205 | let z = x == y; | 206 | let z = x == y; |
@@ -296,8 +297,6 @@ fn test(x: &str, y: isize) { | |||
296 | let b = (a, x); | 297 | let b = (a, x); |
297 | let c = (y, x); | 298 | let c = (y, x); |
298 | let d = (c, x); | 299 | let d = (c, x); |
299 | |||
300 | // we have not infered these case yet. | ||
301 | let e = (1, "e"); | 300 | let e = (1, "e"); |
302 | let f = (e, "d"); | 301 | let f = (e, "d"); |
303 | } | 302 | } |
diff --git a/crates/ra_hir/src/ty/tests/data/binary_op.txt b/crates/ra_hir/src/ty/tests/data/binary_op.txt index 7fdb8a900..58a727691 100644 --- a/crates/ra_hir/src/ty/tests/data/binary_op.txt +++ b/crates/ra_hir/src/ty/tests/data/binary_op.txt | |||
@@ -1,46 +1,46 @@ | |||
1 | [6; 7) 'x': bool | 1 | [6; 7) 'x': bool |
2 | [22; 34) '{ 0i32 }': i32 | 2 | [22; 34) '{ 0i32 }': i32 |
3 | [28; 32) '0i32': i32 | 3 | [28; 32) '0i32': i32 |
4 | [46; 342) '{ ... < 3 }': bool | 4 | [54; 350) '{ ... < 3 }': bool |
5 | [56; 57) 'x': bool | 5 | [64; 65) 'x': bool |
6 | [60; 61) 'a': bool | 6 | [68; 69) 'a': bool |
7 | [60; 66) 'a && b': bool | 7 | [68; 74) 'a && b': bool |
8 | [65; 66) 'b': bool | 8 | [73; 74) 'b': bool |
9 | [76; 77) 'y': bool | 9 | [84; 85) 'y': bool |
10 | [80; 84) 'true': bool | 10 | [88; 92) 'true': bool |
11 | [80; 93) 'true || false': bool | 11 | [88; 101) 'true || false': bool |
12 | [88; 93) 'false': bool | 12 | [96; 101) 'false': bool |
13 | [103; 104) 'z': bool | 13 | [111; 112) 'z': bool |
14 | [107; 108) 'x': bool | 14 | [115; 116) 'x': bool |
15 | [107; 113) 'x == y': bool | 15 | [115; 121) 'x == y': bool |
16 | [112; 113) 'y': bool | 16 | [120; 121) 'y': bool |
17 | [123; 134) 'minus_forty': isize | 17 | [131; 142) 'minus_forty': isize |
18 | [144; 152) '-40isize': isize | 18 | [152; 160) '-40isize': isize |
19 | [145; 152) '40isize': isize | 19 | [153; 160) '40isize': isize |
20 | [162; 163) 'h': bool | 20 | [170; 171) 'h': bool |
21 | [166; 177) 'minus_forty': isize | 21 | [174; 185) 'minus_forty': isize |
22 | [166; 188) 'minus_...ONST_2': bool | 22 | [174; 196) 'minus_...ONST_2': bool |
23 | [181; 188) 'CONST_2': isize | 23 | [189; 196) 'CONST_2': isize |
24 | [198; 199) 'c': i32 | 24 | [206; 207) 'c': i32 |
25 | [202; 203) 'f': fn(bool) -> i32 | 25 | [210; 211) 'f': fn(bool) -> i32 |
26 | [202; 211) 'f(z || y)': i32 | 26 | [210; 219) 'f(z || y)': i32 |
27 | [202; 215) 'f(z || y) + 5': i32 | 27 | [210; 223) 'f(z || y) + 5': i32 |
28 | [204; 205) 'z': bool | 28 | [212; 213) 'z': bool |
29 | [204; 210) 'z || y': bool | 29 | [212; 218) 'z || y': bool |
30 | [209; 210) 'y': bool | 30 | [217; 218) 'y': bool |
31 | [214; 215) '5': i32 | 31 | [222; 223) '5': i32 |
32 | [225; 226) 'd': [unknown] | 32 | [233; 234) 'd': [unknown] |
33 | [229; 230) 'b': [unknown] | 33 | [237; 238) 'b': [unknown] |
34 | [240; 241) 'g': () | 34 | [248; 249) 'g': () |
35 | [244; 255) 'minus_forty': isize | 35 | [252; 263) 'minus_forty': isize |
36 | [244; 260) 'minus_...y ^= i': () | 36 | [252; 268) 'minus_...y ^= i': () |
37 | [259; 260) 'i': isize | 37 | [267; 268) 'i': isize |
38 | [270; 273) 'ten': usize | 38 | [278; 281) 'ten': usize |
39 | [283; 285) '10': usize | 39 | [291; 293) '10': usize |
40 | [295; 308) 'ten_is_eleven': bool | 40 | [303; 316) 'ten_is_eleven': bool |
41 | [311; 314) 'ten': usize | 41 | [319; 322) 'ten': usize |
42 | [311; 326) 'ten == some_num': bool | 42 | [319; 334) 'ten == some_num': bool |
43 | [318; 326) 'some_num': usize | 43 | [326; 334) 'some_num': usize |
44 | [333; 336) 'ten': usize | 44 | [341; 344) 'ten': usize |
45 | [333; 340) 'ten < 3': bool | 45 | [341; 348) 'ten < 3': bool |
46 | [339; 340) '3': usize | 46 | [347; 348) '3': usize |
diff --git a/crates/ra_hir/src/ty/tests/data/literals.txt b/crates/ra_hir/src/ty/tests/data/literals.txt index 8d6079c98..6e82f458f 100644 --- a/crates/ra_hir/src/ty/tests/data/literals.txt +++ b/crates/ra_hir/src/ty/tests/data/literals.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | [11; 101) '{ ...lse; }': () | 1 | [11; 111) '{ ...rue; }': () |
2 | [17; 21) '5i32': i32 | 2 | [17; 21) '5i32': i32 |
3 | [27; 34) '"hello"': &str | 3 | [27; 34) '"hello"': &str |
4 | [40; 48) 'b"bytes"': &[u8] | 4 | [40; 48) 'b"bytes"': &[u8] |
@@ -7,3 +7,4 @@ | |||
7 | [73; 77) '3.14': f64 | 7 | [73; 77) '3.14': f64 |
8 | [83; 87) '5000': i32 | 8 | [83; 87) '5000': i32 |
9 | [93; 98) 'false': bool | 9 | [93; 98) 'false': bool |
10 | [104; 108) 'true': bool | ||
diff --git a/crates/ra_hir/src/ty/tests/data/tuple.txt b/crates/ra_hir/src/ty/tests/data/tuple.txt index 96169180d..a95d3c286 100644 --- a/crates/ra_hir/src/ty/tests/data/tuple.txt +++ b/crates/ra_hir/src/ty/tests/data/tuple.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | [9; 10) 'x': &str | 1 | [9; 10) 'x': &str |
2 | [18; 19) 'y': isize | 2 | [18; 19) 'y': isize |
3 | [28; 214) '{ ...d"); }': () | 3 | [28; 170) '{ ...d"); }': () |
4 | [38; 39) 'a': (u32, &str) | 4 | [38; 39) 'a': (u32, &str) |
5 | [55; 63) '(1, "a")': (u32, &str) | 5 | [55; 63) '(1, "a")': (u32, &str) |
6 | [56; 57) '1': u32 | 6 | [56; 57) '1': u32 |
@@ -17,11 +17,11 @@ | |||
17 | [117; 123) '(c, x)': ((isize, &str), &str) | 17 | [117; 123) '(c, x)': ((isize, &str), &str) |
18 | [118; 119) 'c': (isize, &str) | 18 | [118; 119) 'c': (isize, &str) |
19 | [121; 122) 'x': &str | 19 | [121; 122) 'x': &str |
20 | [177; 178) 'e': ([unknown], [unknown]) | 20 | [133; 134) 'e': (i32, &str) |
21 | [181; 189) '(1, "e")': ([unknown], [unknown]) | 21 | [137; 145) '(1, "e")': (i32, &str) |
22 | [182; 183) '1': [unknown] | 22 | [138; 139) '1': i32 |
23 | [185; 188) '"e"': [unknown] | 23 | [141; 144) '"e"': &str |
24 | [199; 200) 'f': (([unknown], [unknown]), [unknown]) | 24 | [155; 156) 'f': ((i32, &str), &str) |
25 | [203; 211) '(e, "d")': (([unknown], [unknown]), [unknown]) | 25 | [159; 167) '(e, "d")': ((i32, &str), &str) |
26 | [204; 205) 'e': ([unknown], [unknown]) | 26 | [160; 161) 'e': (i32, &str) |
27 | [207; 210) '"d"': [unknown] | 27 | [163; 166) '"d"': &str |