@ -19,6 +19,7 @@ async fn insert_basic() -> anyhow::Result<()> {
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "{}#[|{}]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "{}#[|{}]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -46,6 +47,7 @@ async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> {
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "i{}" , open ) ,
format! ( "i{}" , open ) ,
format! ( "{}#[|{}]#{}" , open , close , LINE_END ) ,
format! ( "{}#[|{}]#{}" , open , close , LINE_END ) ,
LineFeedHandling ::AsIs ,
) ,
) ,
)
)
. await ? ;
. await ? ;
@ -56,6 +58,7 @@ async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> {
format! ( "{}#[{}|]#{}" , open , close , LINE_END ) ,
format! ( "{}#[{}|]#{}" , open , close , LINE_END ) ,
format! ( "i{}" , close ) ,
format! ( "i{}" , close ) ,
format! ( "{}{}#[|{}]#" , open , close , LINE_END ) ,
format! ( "{}{}#[|{}]#" , open , close , LINE_END ) ,
LineFeedHandling ::AsIs ,
) ,
) ,
)
)
. await ? ;
. await ? ;
@ -71,6 +74,7 @@ async fn insert_after_word() -> anyhow::Result<()> {
format! ( "foo#[{}|]#" , LINE_END ) ,
format! ( "foo#[{}|]#" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "foo{}#[|{}]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "foo{}#[|{}]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -80,6 +84,7 @@ async fn insert_after_word() -> anyhow::Result<()> {
format! ( "foo#[{}|]#" , LINE_END ) ,
format! ( "foo#[{}|]#" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "foo{}#[|{}]#" , pair . 0 , LINE_END ) ,
format! ( "foo{}#[|{}]#" , pair . 0 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -94,6 +99,7 @@ async fn insert_before_word() -> anyhow::Result<()> {
format! ( "#[f|]#oo{}" , LINE_END ) ,
format! ( "#[f|]#oo{}" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "{}#[|f]#oo{}" , pair . 0 , LINE_END ) ,
format! ( "{}#[|f]#oo{}" , pair . 0 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -108,6 +114,7 @@ async fn insert_before_word_selection() -> anyhow::Result<()> {
format! ( "#[foo|]#{}" , LINE_END ) ,
format! ( "#[foo|]#{}" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "{}#[|foo]#{}" , pair . 0 , LINE_END ) ,
format! ( "{}#[|foo]#{}" , pair . 0 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -122,6 +129,7 @@ async fn insert_before_word_selection_trailing_word() -> anyhow::Result<()> {
format! ( "foo#[ wor|]#{}" , LINE_END ) ,
format! ( "foo#[ wor|]#{}" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "foo{}#[|{} wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "foo{}#[|{} wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -136,6 +144,7 @@ async fn insert_closer_selection_trailing_word() -> anyhow::Result<()> {
format! ( "foo{}#[|{} wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "foo{}#[|{} wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "i{}" , pair . 1 ) ,
format! ( "i{}" , pair . 1 ) ,
format! ( "foo{}{}#[| wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
format! ( "foo{}{}#[| wor]#{}" , pair . 0 , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -155,6 +164,7 @@ async fn insert_before_eol() -> anyhow::Result<()> {
open = pair . 0 ,
open = pair . 0 ,
close = pair . 1
close = pair . 1
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -177,6 +187,7 @@ async fn insert_auto_pairs_disabled() -> anyhow::Result<()> {
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "#[{}|]#" , LINE_END ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "i{}" , pair . 0 ) ,
format! ( "{}#[|{}]#" , pair . 0 , LINE_END ) ,
format! ( "{}#[|{}]#" , pair . 0 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) ,
) ,
)
)
. await ? ;
. await ? ;
@ -197,6 +208,7 @@ async fn insert_multi_range() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -211,6 +223,7 @@ async fn insert_before_multi_code_point_graphemes() -> anyhow::Result<()> {
format! ( "hello #[👨👩👧👦|]# goodbye{}" , LINE_END ) ,
format! ( "hello #[👨👩👧👦|]# goodbye{}" , LINE_END ) ,
format! ( "i{}" , pair . 1 ) ,
format! ( "i{}" , pair . 1 ) ,
format! ( "hello {}#[|👨👩👧👦]# goodbye{}" , pair . 1 , LINE_END ) ,
format! ( "hello {}#[|👨👩👧👦]# goodbye{}" , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -226,6 +239,7 @@ async fn insert_at_end_of_document() -> anyhow::Result<()> {
in_keys : format ! ( "i{}" , pair . 0 ) ,
in_keys : format ! ( "i{}" , pair . 0 ) ,
out_text : format ! ( "{}{}{}" , LINE_END , pair . 0 , pair . 1 ) ,
out_text : format ! ( "{}{}{}" , LINE_END , pair . 0 , pair . 1 ) ,
out_selection : Selection ::single ( LINE_END . len ( ) + 1 , LINE_END . len ( ) + 2 ) ,
out_selection : Selection ::single ( LINE_END . len ( ) + 1 , LINE_END . len ( ) + 2 ) ,
line_feed_handling : LineFeedHandling ::AsIs ,
} )
} )
. await ? ;
. await ? ;
@ -235,6 +249,7 @@ async fn insert_at_end_of_document() -> anyhow::Result<()> {
in_keys : format ! ( "i{}" , pair . 0 ) ,
in_keys : format ! ( "i{}" , pair . 0 ) ,
out_text : format ! ( "foo{}{}{}" , LINE_END , pair . 0 , pair . 1 ) ,
out_text : format ! ( "foo{}{}{}" , LINE_END , pair . 0 , pair . 1 ) ,
out_selection : Selection ::single ( LINE_END . len ( ) + 4 , LINE_END . len ( ) + 5 ) ,
out_selection : Selection ::single ( LINE_END . len ( ) + 4 , LINE_END . len ( ) + 5 ) ,
line_feed_handling : LineFeedHandling ::AsIs ,
} )
} )
. await ? ;
. await ? ;
}
}
@ -259,6 +274,7 @@ async fn insert_close_inside_pair() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -283,6 +299,7 @@ async fn insert_close_inside_pair_multi() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -307,6 +324,7 @@ async fn insert_nested_open_inside_pair() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -338,6 +356,7 @@ async fn insert_nested_open_inside_pair_multi() -> anyhow::Result<()> {
inner_close = inner_pair . 1 ,
inner_close = inner_pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -358,6 +377,7 @@ async fn append_basic() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -377,6 +397,7 @@ async fn append_multi_range() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -401,6 +422,7 @@ async fn append_close_inside_pair() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -425,6 +447,7 @@ async fn append_close_inside_pair_multi() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -444,6 +467,7 @@ async fn append_end_of_word() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -458,6 +482,7 @@ async fn append_middle_of_word() -> anyhow::Result<()> {
format! ( "#[wo|]#rd{}" , LINE_END ) ,
format! ( "#[wo|]#rd{}" , LINE_END ) ,
format! ( "a{}" , pair . 1 ) ,
format! ( "a{}" , pair . 1 ) ,
format! ( "#[wo{}r|]#d{}" , pair . 1 , LINE_END ) ,
format! ( "#[wo{}r|]#d{}" , pair . 1 , LINE_END ) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -477,6 +502,7 @@ async fn append_end_of_word_multi() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -501,6 +527,7 @@ async fn append_inside_nested_pair() -> anyhow::Result<()> {
close = pair . 1 ,
close = pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}
@ -532,6 +559,7 @@ async fn append_inside_nested_pair_multi() -> anyhow::Result<()> {
inner_close = inner_pair . 1 ,
inner_close = inner_pair . 1 ,
eol = LINE_END
eol = LINE_END
) ,
) ,
LineFeedHandling ::AsIs ,
) )
) )
. await ? ;
. await ? ;
}
}