aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/tests')
-rw-r--r--helix-term/tests/test/commands.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs
index b3e13551..e52b142c 100644
--- a/helix-term/tests/test/commands.rs
+++ b/helix-term/tests/test/commands.rs
@@ -480,3 +480,49 @@ fn bar() {#(\n|)#\
Ok(())
}
+
+#[tokio::test(flavor = "multi_thread")]
+async fn test_join_selections() -> anyhow::Result<()> {
+ // normal join
+ test((
+ platform_line(indoc! {"\
+ #[a|]#bc
+ def
+ "}),
+ "J",
+ platform_line(indoc! {"\
+ #[a|]#bc def
+ "}),
+ ))
+ .await?;
+
+ // join with empty line
+ test((
+ platform_line(indoc! {"\
+ #[a|]#bc
+
+ def
+ "}),
+ "JJ",
+ platform_line(indoc! {"\
+ #[a|]#bc def
+ "}),
+ ))
+ .await?;
+
+ // join with additional space in non-empty line
+ test((
+ platform_line(indoc! {"\
+ #[a|]#bc
+
+ def
+ "}),
+ "JJ",
+ platform_line(indoc! {"\
+ #[a|]#bc def
+ "}),
+ ))
+ .await?;
+
+ Ok(())
+}