From 4c5ceb5bed698089311acda226fcf72071d5a0de Mon Sep 17 00:00:00 2001 From: Nikita Revenco <154856872+NikitaRevenco@users.noreply.github.com> Date: Mon, 3 Feb 2025 21:07:53 +0000 Subject: [PATCH] test: add test for continuing comment in injection layers --- helix-term/tests/test/comments.rs | 87 +++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/helix-term/tests/test/comments.rs b/helix-term/tests/test/comments.rs index d631d9880..feed59800 100644 --- a/helix-term/tests/test/comments.rs +++ b/helix-term/tests/test/comments.rs @@ -86,6 +86,93 @@ async fn test_injected_comment_tokens_simple() -> anyhow::Result<()> { Ok(()) } +#[tokio::test(flavor = "multi_thread")] +async fn test_injected_comment_tokens_continue_comment() -> anyhow::Result<()> { + test(( + indoc! {r#"\ +

Some text 1234

+ + "#}, + ":lang htmli", + indoc! {r#"\ +

Some text 1234

+ + "#}, + )) + .await?; + + test(( + indoc! {r#"\ +

Some text 1234

+ + "#}, + ":lang htmli", + indoc! {r#"\ +

Some text 1234

+ + "#}, + )) + .await?; + + test(( + indoc! {r#"\ +

Some text 1234

+ + "#}, + ":lang htmli", + indoc! {r#"\ +

Some text 1234

+ + "#}, + )) + .await?; + + test(( + indoc! {r#"\ +

Some text 1234

+ + "#}, + ":lang htmlO", + indoc! {r#"\ +

Some text 1234

+ + "#}, + )) + .await?; + + Ok(()) +} + /// Selections in different regions #[tokio::test(flavor = "multi_thread")] async fn test_injected_comment_tokens_multiple_selections() -> anyhow::Result<()> {