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.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 30b5b648e..a62704c39 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -446,6 +446,11 @@ struct Foo {
446} 446}
447 447
448impl Foo { 448impl Foo {
449 /// ```
450 /// let _ = "Call me
451 // KILLER WHALE
452 /// Ishmael.";
453 /// ```
449 pub const bar: bool = true; 454 pub const bar: bool = true;
450 455
451 /// Constructs a new `Foo`. 456 /// Constructs a new `Foo`.
@@ -555,6 +560,25 @@ impl t for foo {
555 ) 560 )
556} 561}
557 562
563#[test]
564fn test_injection() {
565 check_highlighting(
566 r##"
567fn f(ra_fixture: &str) {}
568fn main() {
569 f(r"
570fn foo() {
571 foo(\$0{
572 92
573 }\$0)
574}");
575}
576 "##,
577 expect_file!["./test_data/injection.html"],
578 false,
579 );
580}
581
558/// Highlights the code given by the `ra_fixture` argument, renders the 582/// Highlights the code given by the `ra_fixture` argument, renders the
559/// result as HTML, and compares it with the HTML file given as `snapshot`. 583/// result as HTML, and compares it with the HTML file given as `snapshot`.
560/// Note that the `snapshot` file is overwritten by the rendered HTML. 584/// Note that the `snapshot` file is overwritten by the rendered HTML.