aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/commands.rs
diff options
context:
space:
mode:
authorGabriel Dinner-David2022-12-31 14:23:55 +0000
committerGitHub2022-12-31 14:23:55 +0000
commit1b1755240db1ca01cbe1371a5b4ac58b68615382 (patch)
tree2dffc451c66cf9733a75c6e07b37f7315a0c916d /helix-term/tests/test/commands.rs
parentc9ed42cdec95b67b0d0ed15218daff37358ca86f (diff)
fix(commands): extend_line to proper line when count and current line selected (#5288)
Diffstat (limited to 'helix-term/tests/test/commands.rs')
-rw-r--r--helix-term/tests/test/commands.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs
index 95bd95b7..6e7275f5 100644
--- a/helix-term/tests/test/commands.rs
+++ b/helix-term/tests/test/commands.rs
@@ -311,3 +311,46 @@ async fn test_undo_redo() -> anyhow::Result<()> {
Ok(())
}
+
+#[tokio::test(flavor = "multi_thread")]
+async fn test_extend_line() -> anyhow::Result<()> {
+ // extend with line selected then count
+ test((
+ platform_line(indoc! {"\
+ #[l|]#orem
+ ipsum
+ dolor
+
+ "})
+ .as_str(),
+ "x2x",
+ platform_line(indoc! {"\
+ #[lorem
+ ipsum
+ dolor
+ |]#
+ "})
+ .as_str(),
+ ))
+ .await?;
+
+ // extend with count on partial selection
+ test((
+ platform_line(indoc! {"\
+ #[l|]#orem
+ ipsum
+
+ "})
+ .as_str(),
+ "2x",
+ platform_line(indoc! {"\
+ #[lorem
+ ipsum
+ |]#
+ "})
+ .as_str(),
+ ))
+ .await?;
+
+ Ok(())
+}