add an integration test

pull/10905/head
Sam Vente 6 months ago
parent f3d15778b4
commit 7395929910
No known key found for this signature in database

@ -501,13 +501,15 @@ fn parse_mark_register_contents(
let mut rv_iter = rv.into_iter(); let mut rv_iter = rv.into_iter();
let Some(doc_id) = rv_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()) .and_then(|s| s.try_into().ok())
else { else {
return Err(anyhow!("Register did not contain valid document id")); return Err(anyhow!("Register did not contain valid document id"));
}; };
let Some(history_rev) = rv_iter let Some(history_rev) = rv_iter
.next().map(|c| c.into_owned()) .next()
.map(|c| c.into_owned())
.and_then(|s| s.parse().ok()) .and_then(|s| s.parse().ok())
else { else {
return Err(anyhow!("Register did not contain valid revision number")); return Err(anyhow!("Register did not contain valid revision number"));

@ -66,23 +66,33 @@ async fn insert_to_normal_mode_cursor_position() -> anyhow::Result<()> {
} }
#[tokio::test(flavor = "multi_thread")] #[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 // add a mark and then immediately paste it out
test(( test((
indoc! {"\ indoc! {"\
Lorem #[|Lorem]#
ipsum ipsum
dolor#[| #(|Lorem)#
sit]# ipsum
amet." #(|Lorem)#
ipsum
#(|Lorem)#
ipsum
#(|Lorem)#
ipsum"
}, },
"1\"^p", ":register_mark<space>1<ret>casdf<esc>:goto_mark<space>1<ret>",
indoc! {"\ indoc! {"\
Lorem #[|asdf]#
ipsum
#(|asdf)#
ipsum
#(|asdf)#
ipsum
#(|asdf)#
ipsum ipsum
dolor #(|asdf)#
sit#[|1:(24,19)]# ipsum"
amet."
}, },
)) ))
.await?; .await?;

Loading…
Cancel
Save