diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 2b667b0d4..5c22e2fce 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -513,6 +513,34 @@ fn test_extern_crate() { | |||
513 | ); | 513 | ); |
514 | } | 514 | } |
515 | 515 | ||
516 | #[test] | ||
517 | fn test_associated_function() { | ||
518 | check_highlighting( | ||
519 | r#" | ||
520 | fn not_static() {} | ||
521 | |||
522 | struct foo {} | ||
523 | |||
524 | impl foo { | ||
525 | pub fn is_static() {} | ||
526 | pub fn is_not_static(&self) {} | ||
527 | } | ||
528 | |||
529 | trait t { | ||
530 | fn t_is_static() {} | ||
531 | fn t_is_not_static(&self) {} | ||
532 | } | ||
533 | |||
534 | impl t for foo { | ||
535 | pub fn is_static() {} | ||
536 | pub fn is_not_static(&self) {} | ||
537 | } | ||
538 | "#, | ||
539 | expect_file!["./test_data/highlight_assoc_functions.html"], | ||
540 | false, | ||
541 | ) | ||
542 | } | ||
543 | |||
516 | /// Highlights the code given by the `ra_fixture` argument, renders the | 544 | /// Highlights the code given by the `ra_fixture` argument, renders the |
517 | /// result as HTML, and compares it with the HTML file given as `snapshot`. | 545 | /// result as HTML, and compares it with the HTML file given as `snapshot`. |
518 | /// Note that the `snapshot` file is overwritten by the rendered HTML. | 546 | /// Note that the `snapshot` file is overwritten by the rendered HTML. |