aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/movement.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-05-22 17:29:52 +0000
committerSkyler Hawthorne2022-06-19 03:57:47 +0000
commit7c0bca186cdacf070355c1a4ab82121d6a4d2e27 (patch)
tree4b0d1e2a09d676d297ecde75e72a93d27e40fe54 /helix-term/tests/test/movement.rs
parent526c9be8cadf99519e8f6a9911b3784ab7f2e142 (diff)
rename test helpers
Diffstat (limited to 'helix-term/tests/test/movement.rs')
-rw-r--r--helix-term/tests/test/movement.rs103
1 files changed, 32 insertions, 71 deletions
diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs
index e0bfc3bf..5fb2ce25 100644
--- a/helix-term/tests/test/movement.rs
+++ b/helix-term/tests/test/movement.rs
@@ -4,39 +4,18 @@ use super::*;
#[tokio::test]
async fn insert_mode_cursor_position() -> anyhow::Result<()> {
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- TestCase {
- in_text: String::new(),
- in_selection: Selection::single(0, 0),
- in_keys: "i".into(),
- out_text: String::new(),
- out_selection: Selection::single(0, 0),
- },
- )
- .await?;
-
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- ("#[\n|]#", "i", "#[|\n]#"),
- )
- .await?;
-
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- ("#[\n|]#", "i<esc>", "#[|\n]#"),
- )
+ test(TestCase {
+ in_text: String::new(),
+ in_selection: Selection::single(0, 0),
+ in_keys: "i".into(),
+ out_text: String::new(),
+ out_selection: Selection::single(0, 0),
+ })
.await?;
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- ("#[\n|]#", "i<esc>i", "#[|\n]#"),
- )
- .await?;
+ test(("#[\n|]#", "i", "#[|\n]#")).await?;
+ test(("#[\n|]#", "i<esc>", "#[|\n]#")).await?;
+ test(("#[\n|]#", "i<esc>i", "#[|\n]#")).await?;
Ok(())
}
@@ -44,62 +23,44 @@ async fn insert_mode_cursor_position() -> anyhow::Result<()> {
/// Range direction is preserved when escaping insert mode to normal
#[tokio::test]
async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> {
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- ("#[f|]#oo\n", "vll<A-;><esc>", "#[|foo]#\n"),
- )
- .await?;
-
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- (
- indoc! {"\
+ test(("#[f|]#oo\n", "vll<A-;><esc>", "#[|foo]#\n")).await?;
+ test((
+ indoc! {"\
#[f|]#oo
#(b|)#ar"
- },
- "vll<A-;><esc>",
- indoc! {"\
+ },
+ "vll<A-;><esc>",
+ indoc! {"\
#[|foo]#
#(|bar)#"
- },
- ),
- )
+ },
+ ))
.await?;
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- (
- indoc! {"\
+ test((
+ indoc! {"\
#[f|]#oo
#(b|)#ar"
- },
- "a",
- indoc! {"\
+ },
+ "a",
+ indoc! {"\
#[fo|]#o
#(ba|)#r"
- },
- ),
- )
+ },
+ ))
.await?;
- test_key_sequence_text_result(
- Args::default(),
- Config::default(),
- (
- indoc! {"\
+ test((
+ indoc! {"\
#[f|]#oo
#(b|)#ar"
- },
- "a<esc>",
- indoc! {"\
+ },
+ "a<esc>",
+ indoc! {"\
#[f|]#oo
#(b|)#ar"
- },
- ),
- )
+ },
+ ))
.await?;
Ok(())