diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index b6e952b08..8c8878d36 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -39,11 +39,11 @@ struct Foo { | |||
39 | pub y: i32, | 39 | pub y: i32, |
40 | } | 40 | } |
41 | 41 | ||
42 | trait Bar { | 42 | trait Bar where Self: { |
43 | fn bar(&self) -> i32; | 43 | fn bar(&self) -> i32; |
44 | } | 44 | } |
45 | 45 | ||
46 | impl Bar for Foo { | 46 | impl Bar for Foo where Self: { |
47 | fn bar(&self) -> i32 { | 47 | fn bar(&self) -> i32 { |
48 | self.x | 48 | self.x |
49 | } | 49 | } |
@@ -208,6 +208,17 @@ impl<T> Option<T> { | |||
208 | } | 208 | } |
209 | } | 209 | } |
210 | } | 210 | } |
211 | |||
212 | async fn learn_and_sing() { | ||
213 | let song = learn_song().await; | ||
214 | sing_song(song).await; | ||
215 | } | ||
216 | |||
217 | async fn async_main() { | ||
218 | let f1 = learn_and_sing(); | ||
219 | let f2 = dance(); | ||
220 | futures::join!(f1, f2); | ||
221 | } | ||
211 | "# | 222 | "# |
212 | .trim(), | 223 | .trim(), |
213 | expect_file!["./test_data/highlighting.html"], | 224 | expect_file!["./test_data/highlighting.html"], |
@@ -513,6 +524,11 @@ fn main() { | |||
513 | fn test_highlight_doc_comment() { | 524 | fn test_highlight_doc_comment() { |
514 | check_highlighting( | 525 | check_highlighting( |
515 | r#" | 526 | r#" |
527 | //! This is a module to test doc injection. | ||
528 | //! ``` | ||
529 | //! fn test() {} | ||
530 | //! ``` | ||
531 | |||
516 | /// ``` | 532 | /// ``` |
517 | /// let _ = "early doctests should not go boom"; | 533 | /// let _ = "early doctests should not go boom"; |
518 | /// ``` | 534 | /// ``` |
@@ -520,6 +536,13 @@ struct Foo { | |||
520 | bar: bool, | 536 | bar: bool, |
521 | } | 537 | } |
522 | 538 | ||
539 | /// This is an impl with a code block. | ||
540 | /// | ||
541 | /// ``` | ||
542 | /// fn foo() { | ||
543 | /// | ||
544 | /// } | ||
545 | /// ``` | ||
523 | impl Foo { | 546 | impl Foo { |
524 | /// ``` | 547 | /// ``` |
525 | /// let _ = "Call me | 548 | /// let _ = "Call me |