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 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"));

@ -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_mark<space>1<ret>casdf<esc>:goto_mark<space>1<ret>",
indoc! {"\
Lorem
#[|asdf]#
ipsum
#(|asdf)#
ipsum
#(|asdf)#
ipsum
#(|asdf)#
ipsum
dolor
sit#[|1:(24,19)]#
amet."
#(|asdf)#
ipsum"
},
))
.await?;

Loading…
Cancel
Save