aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-07 15:21:00 +0000
committerAleksey Kladov <[email protected]>2021-01-07 16:11:27 +0000
commitf459375f4873d601b6a0e2c3c5d29be569b3e067 (patch)
tree97bceccdbcfa1a5f5b932c16786e7339b4ff39da /crates/ide/src/syntax_highlighting/tests.rs
parent7967ce85cfc5fc2b1996425b44f2a45d0841c8ff (diff)
Better fixture highlight
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 30b5b648e..9e1a3974c 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -555,6 +555,25 @@ impl t for foo {
555 ) 555 )
556} 556}
557 557
558#[test]
559fn test_injection() {
560 check_highlighting(
561 r##"
562fn f(ra_fixture: &str) {}
563fn main() {
564 f(r"
565fn foo() {
566 foo(\$0{
567 92
568 }\$0)
569}");
570}
571 "##,
572 expect_file!["./test_data/injection.html"],
573 false,
574 );
575}
576
558/// Highlights the code given by the `ra_fixture` argument, renders the 577/// 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`. 578/// 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. 579/// Note that the `snapshot` file is overwritten by the rendered HTML.