Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/tests/test/movement.rs')
-rw-r--r--helix-term/tests/test/movement.rs43
1 files changed, 43 insertions, 0 deletions
diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs
index 3fa85092..77098a33 100644
--- a/helix-term/tests/test/movement.rs
+++ b/helix-term/tests/test/movement.rs
@@ -107,6 +107,14 @@ async fn surround_by_character() -> anyhow::Result<()> {
))
.await?;
+ // Selection direction is preserved
+ test((
+ "(so [many {go#[|od]#} text] here)",
+ "mi{",
+ "(so [many {#[|good]#} text] here)",
+ ))
+ .await?;
+
Ok(())
}
@@ -366,6 +374,41 @@ async fn surround_around_pair() -> anyhow::Result<()> {
Ok(())
}
+#[tokio::test(flavor = "multi_thread")]
+async fn match_around_closest_ts() -> anyhow::Result<()> {
+ test_with_config(
+ AppBuilder::new().with_file("foo.rs", None),
+ (
+ r#"fn main() {todo!{"f#[|oo]#)"};}"#,
+ "mam",
+ r#"fn main() {todo!{#[|"foo)"]#};}"#,
+ ),
+ )
+ .await?;
+
+ test_with_config(
+ AppBuilder::new().with_file("foo.rs", None),
+ (
+ r##"fn main() { let _ = ("#[|1]#23", "#(|1)#23"); } "##,
+ "3mam",
+ r##"fn main() #[|{ let _ = ("123", "123"); }]# "##,
+ ),
+ )
+ .await?;
+
+ test_with_config(
+ AppBuilder::new().with_file("foo.rs", None),
+ (
+ r##" fn main() { let _ = ("12#[|3", "12]#3"); } "##,
+ "1mam",
+ r##" fn main() { let _ = #[|("123", "123")]#; } "##,
+ ),
+ )
+ .await?;
+
+ Ok(())
+}
+
/// Ensure the very initial cursor in an opened file is the width of
/// the first grapheme
#[tokio::test(flavor = "multi_thread")]