Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs44
1 files changed, 43 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 58c613ef7c..89a5e434f9 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -1183,7 +1183,7 @@ fn main() {
foo!(Bar);
fn func(_: y::Bar) {
mod inner {
- struct Innerest<const C: usize> { field: [(); {C}] }
+ struct Innerest<const C: usize> { field: [u32; {C}], field2: &Innerest }
}
}
}
@@ -1511,3 +1511,45 @@ fn main() {
false,
);
}
+
+#[test]
+fn test_deprecated_highlighting() {
+ check_highlighting(
+ r#"
+//- /foo.rs crate:foo deps:bar
+#![deprecated]
+use crate as _;
+extern crate bar;
+#[deprecated]
+macro_rules! macro_ {
+ () => {};
+}
+#[deprecated]
+mod mod_ {}
+#[deprecated]
+fn func() {}
+#[deprecated]
+struct Struct {
+ #[deprecated]
+ field: u32
+}
+#[deprecated]
+enum Enum {
+ #[deprecated]
+ Variant
+}
+#[deprecated]
+const CONST: () = ();
+#[deprecated]
+trait Trait {}
+#[deprecated]
+type Alias = ();
+#[deprecated]
+static STATIC: () = ();
+//- /bar.rs crate:bar
+#![deprecated]
+ "#,
+ expect_file!["./test_data/highlight_deprecated.html"],
+ false,
+ );
+}