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.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 2b667b0d4..1dc018a16 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -340,6 +340,8 @@ fn main() {
340 340
341 println!("{\x41}", A = 92); 341 println!("{\x41}", A = 92);
342 println!("{ничоси}", ничоси = 92); 342 println!("{ничоси}", ничоси = 92);
343
344 println!("{:x?} {} ", thingy, n2);
343}"# 345}"#
344 .trim(), 346 .trim(),
345 expect_file!["./test_data/highlight_strings.html"], 347 expect_file!["./test_data/highlight_strings.html"],
@@ -513,6 +515,34 @@ fn test_extern_crate() {
513 ); 515 );
514} 516}
515 517
518#[test]
519fn test_associated_function() {
520 check_highlighting(
521 r#"
522fn not_static() {}
523
524struct foo {}
525
526impl foo {
527 pub fn is_static() {}
528 pub fn is_not_static(&self) {}
529}
530
531trait t {
532 fn t_is_static() {}
533 fn t_is_not_static(&self) {}
534}
535
536impl t for foo {
537 pub fn is_static() {}
538 pub fn is_not_static(&self) {}
539}
540 "#,
541 expect_file!["./test_data/highlight_assoc_functions.html"],
542 false,
543 )
544}
545
516/// Highlights the code given by the `ra_fixture` argument, renders the 546/// 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`. 547/// 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. 548/// Note that the `snapshot` file is overwritten by the rendered HTML.