aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tests.rs24
1 files changed, 15 insertions, 9 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs
index 2d90a072f..98c030791 100644
--- a/crates/ra_ide/src/syntax_highlighting/tests.rs
+++ b/crates/ra_ide/src/syntax_highlighting/tests.rs
@@ -17,9 +17,8 @@ struct Foo {
17 pub y: i32, 17 pub y: i32,
18} 18}
19 19
20fn foo<T>() -> T { 20fn foo<'a, T>() -> T {
21 unimplemented!(); 21 foo::<'a, i32>()
22 foo::<i32>();
23} 22}
24 23
25macro_rules! def_fn { 24macro_rules! def_fn {
@@ -50,12 +49,19 @@ fn main() {
50 y; 49 y;
51} 50}
52 51
53enum E<X> { 52enum Option<T> {
54 V(X) 53 Some(T),
54 None,
55} 55}
56 56use Option::*;
57impl<X> E<X> { 57
58 fn new<T>() -> E<T> {} 58impl<T> Option<T> {
59 fn and<U>(self, other: Option<U>) -> Option<(T, U)> {
60 match other {
61 None => unimplemented!(),
62 Nope => Nope,
63 }
64 }
59} 65}
60"# 66"#
61 .trim(), 67 .trim(),
@@ -123,5 +129,5 @@ fn test_ranges() {
123 .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) }) 129 .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) })
124 .unwrap(); 130 .unwrap();
125 131
126 assert_eq!(&highlights[0].highlight.to_string(), "field"); 132 assert_eq!(&highlights[0].highlight.to_string(), "field.declaration");
127} 133}