diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 4f0b1ce85..502a88af2 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -242,6 +242,14 @@ fn use_foo_items() { | |||
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | pub enum Bool { True, False } | ||
246 | |||
247 | impl Bool { | ||
248 | pub const fn to_primitive(self) -> bool { | ||
249 | matches!(self, Self::True) | ||
250 | } | ||
251 | } | ||
252 | const USAGE_OF_BOOL:bool = Bool::True.to_primitive(); | ||
245 | 253 | ||
246 | //- /foo.rs crate:foo | 254 | //- /foo.rs crate:foo |
247 | pub struct Person { | 255 | pub struct Person { |
@@ -390,7 +398,7 @@ struct Foo { | |||
390 | .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) }) | 398 | .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) }) |
391 | .unwrap(); | 399 | .unwrap(); |
392 | 400 | ||
393 | assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); | 401 | assert_eq!(&highlights[0].highlight.to_string(), "field.declaration.public"); |
394 | } | 402 | } |
395 | 403 | ||
396 | #[test] | 404 | #[test] |