aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-07 16:11:54 +0000
committerGitHub <[email protected]>2021-01-07 16:11:54 +0000
commit344704a054fe3cf9c54893c2bfa0ec6ebbabf692 (patch)
tree5f0063b4d3b5b7f78a76d375f4237763bdd82221 /crates/ide/src/syntax_highlighting/tests.rs
parentb821264f861be959709aa0e7e87b4c5e1ce335b5 (diff)
parentf459375f4873d601b6a0e2c3c5d29be569b3e067 (diff)
Merge #7196
7196: Better fixture highlight r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
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.