From 739592991007a44ae8362632985e160b17aa1559 Mon Sep 17 00:00:00 2001 From: Sam Vente Date: Sun, 9 Jun 2024 21:08:18 +0200 Subject: [PATCH] add an integration test --- helix-term/src/commands/typed.rs | 6 ++++-- helix-term/tests/test/movement.rs | 30 ++++++++++++++++++++---------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 71a182790..5a2c65549 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -501,13 +501,15 @@ fn parse_mark_register_contents( let mut rv_iter = rv.into_iter(); let Some(doc_id) = rv_iter - .next().map(|c| c.into_owned()) + .next() + .map(|c| c.into_owned()) .and_then(|s| s.try_into().ok()) else { return Err(anyhow!("Register did not contain valid document id")); }; let Some(history_rev) = rv_iter - .next().map(|c| c.into_owned()) + .next() + .map(|c| c.into_owned()) .and_then(|s| s.parse().ok()) else { return Err(anyhow!("Register did not contain valid revision number")); diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs index 48b2ae1b9..6ea29cb0e 100644 --- a/helix-term/tests/test/movement.rs +++ b/helix-term/tests/test/movement.rs @@ -66,23 +66,33 @@ async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> { } #[tokio::test(flavor = "multi_thread")] -async fn register_mark() -> anyhow::Result<()> { +async fn bookmark() -> anyhow::Result<()> { // add a mark and then immediately paste it out test(( indoc! {"\ - Lorem + #[|Lorem]# ipsum - dolor#[| - sit]# - amet." + #(|Lorem)# + ipsum + #(|Lorem)# + ipsum + #(|Lorem)# + ipsum + #(|Lorem)# + ipsum" }, - "1\"^p", + ":register_mark1casdf:goto_mark1", indoc! {"\ - Lorem + #[|asdf]# + ipsum + #(|asdf)# + ipsum + #(|asdf)# + ipsum + #(|asdf)# ipsum - dolor - sit#[|1:(24,19)]# - amet." + #(|asdf)# + ipsum" }, )) .await?;