aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs28
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]
517fn test_associated_function() {
518 check_highlighting(
519 r#"
520fn not_static() {}
521
522struct foo {}
523
524impl foo {
525 pub fn is_static() {}
526 pub fn is_not_static(&self) {}
527}
528
529trait t {
530 fn t_is_static() {}
531 fn t_is_not_static(&self) {}
532}
533
534impl 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.