Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/tests/test/commands/reverse_selection_contents.rs')
-rw-r--r--helix-term/tests/test/commands/reverse_selection_contents.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/helix-term/tests/test/commands/reverse_selection_contents.rs b/helix-term/tests/test/commands/reverse_selection_contents.rs
new file mode 100644
index 00000000..043a03c3
--- /dev/null
+++ b/helix-term/tests/test/commands/reverse_selection_contents.rs
@@ -0,0 +1,49 @@
+use super::*;
+
+const A: &str = indoc! {"
+ #(a|)#
+ #(b|)#
+ #(c|)#
+ #[d|]#
+ #(e|)#"
+};
+const A_REV: &str = indoc! {"
+ #(e|)#
+ #[d|]#
+ #(c|)#
+ #(b|)#
+ #(a|)#"
+};
+const B: &str = indoc! {"
+ #(a|)#
+ #(b|)#
+ #[c|]#
+ #(d|)#
+ #(e|)#"
+};
+const B_REV: &str = indoc! {"
+ #(e|)#
+ #(d|)#
+ #[c|]#
+ #(b|)#
+ #(a|)#"
+};
+
+const CMD: &str = "<space>?reverse_selection_contents<ret>";
+
+#[tokio::test(flavor = "multi_thread")]
+async fn reverse_selection_contents() -> anyhow::Result<()> {
+ test((A, CMD, A_REV)).await?;
+ test((B, CMD, B_REV)).await?;
+
+ Ok(())
+}
+
+#[tokio::test(flavor = "multi_thread")]
+async fn reverse_selection_contents_with_count() -> anyhow::Result<()> {
+ test((B, format!("2{CMD}"), B)).await?;
+ test((B, format!("3{CMD}"), B_REV)).await?;
+ test((B, format!("4{CMD}"), B)).await?;
+
+ Ok(())
+}