Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/tests/test/commands.rs')
-rw-r--r--helix-term/tests/test/commands.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs
index 9f196827..f71ae308 100644
--- a/helix-term/tests/test/commands.rs
+++ b/helix-term/tests/test/commands.rs
@@ -633,6 +633,41 @@ async fn test_join_selections_space() -> anyhow::Result<()> {
}
#[tokio::test(flavor = "multi_thread")]
+async fn test_join_selections_comment() -> anyhow::Result<()> {
+ test((
+ indoc! {"\
+ /// #[a|]#bc
+ /// def
+ "},
+ ":lang rust<ret>J",
+ indoc! {"\
+ /// #[a|]#bc def
+ "},
+ ))
+ .await?;
+
+ // Only join if the comment token matches the previous line.
+ test((
+ indoc! {"\
+ #[| // a
+ // b
+ /// c
+ /// d
+ e
+ /// f
+ // g]#
+ "},
+ ":lang rust<ret>J",
+ indoc! {"\
+ #[| // a b /// c d e f // g]#
+ "},
+ ))
+ .await?;
+
+ Ok(())
+}
+
+#[tokio::test(flavor = "multi_thread")]
async fn test_read_file() -> anyhow::Result<()> {
let mut file = tempfile::NamedTempFile::new()?;
let contents_to_read = "some contents";