|
|
@ -12,15 +12,13 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
#[lo|]#rem
|
|
|
|
#[lo|]#rem
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
dolor
|
|
|
|
dolor
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"CC",
|
|
|
|
"CC",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#(lo|)#rem
|
|
|
|
#(lo|)#rem
|
|
|
|
#(ip|)#sum
|
|
|
|
#(ip|)#sum
|
|
|
|
#[do|]#lor
|
|
|
|
#[do|]#lor
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -30,15 +28,13 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
#[|lo]#rem
|
|
|
|
#[|lo]#rem
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
dolor
|
|
|
|
dolor
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"CC",
|
|
|
|
"CC",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#(|lo)#rem
|
|
|
|
#(|lo)#rem
|
|
|
|
#(|ip)#sum
|
|
|
|
#(|ip)#sum
|
|
|
|
#[|do]#lor
|
|
|
|
#[|do]#lor
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -47,14 +43,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
test
|
|
|
|
test
|
|
|
|
#[testitem|]#
|
|
|
|
#[testitem|]#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"<A-C>",
|
|
|
|
"<A-C>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
test
|
|
|
|
test
|
|
|
|
#[testitem|]#
|
|
|
|
#[testitem|]#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -63,14 +57,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
test
|
|
|
|
test
|
|
|
|
#[test|]#
|
|
|
|
#[test|]#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"<A-C>",
|
|
|
|
"<A-C>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[test|]#
|
|
|
|
#[test|]#
|
|
|
|
#(test|)#
|
|
|
|
#(test|)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -79,14 +71,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[testitem|]#
|
|
|
|
#[testitem|]#
|
|
|
|
test
|
|
|
|
test
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"C",
|
|
|
|
"C",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[testitem|]#
|
|
|
|
#[testitem|]#
|
|
|
|
test
|
|
|
|
test
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -95,14 +85,12 @@ async fn test_selection_duplication() -> anyhow::Result<()> {
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[test|]#
|
|
|
|
#[test|]#
|
|
|
|
test
|
|
|
|
test
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"C",
|
|
|
|
"C",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#(test|)#
|
|
|
|
#(test|)#
|
|
|
|
#[test|]#
|
|
|
|
#[test|]#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
@ -174,15 +162,13 @@ async fn test_multi_selection_paste() -> anyhow::Result<()> {
|
|
|
|
#[|lorem]#
|
|
|
|
#[|lorem]#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|dolor)#
|
|
|
|
#(|dolor)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"yp",
|
|
|
|
"yp",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
lorem#[|lorem]#
|
|
|
|
lorem#[|lorem]#
|
|
|
|
ipsum#(|ipsum)#
|
|
|
|
ipsum#(|ipsum)#
|
|
|
|
dolor#(|dolor)#
|
|
|
|
dolor#(|dolor)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -197,8 +183,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
#[|lorem]#
|
|
|
|
#[|lorem]#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|dolor)#
|
|
|
|
#(|dolor)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"|echo foo<ret>",
|
|
|
|
"|echo foo<ret>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[|foo\n]#
|
|
|
|
#[|foo\n]#
|
|
|
@ -207,8 +192,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
|
|
|
|
|
|
|
|
#(|foo\n)#
|
|
|
|
#(|foo\n)#
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -218,8 +202,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
#[|lorem]#
|
|
|
|
#[|lorem]#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|dolor)#
|
|
|
|
#(|dolor)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"!echo foo<ret>",
|
|
|
|
"!echo foo<ret>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[|foo\n]#
|
|
|
|
#[|foo\n]#
|
|
|
@ -228,8 +211,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
#(|foo\n)#
|
|
|
|
#(|foo\n)#
|
|
|
|
dolor
|
|
|
|
dolor
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -239,8 +221,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
#[|lorem]#
|
|
|
|
#[|lorem]#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|ipsum)#
|
|
|
|
#(|dolor)#
|
|
|
|
#(|dolor)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"<A-!>echo foo<ret>",
|
|
|
|
"<A-!>echo foo<ret>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
lorem#[|foo\n]#
|
|
|
|
lorem#[|foo\n]#
|
|
|
@ -249,8 +230,7 @@ async fn test_multi_selection_shell_commands() -> anyhow::Result<()> {
|
|
|
|
|
|
|
|
|
|
|
|
dolor#(|foo\n)#
|
|
|
|
dolor#(|foo\n)#
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -294,16 +274,14 @@ async fn test_extend_line() -> anyhow::Result<()> {
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
dolor
|
|
|
|
dolor
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"x2x",
|
|
|
|
"x2x",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[lorem
|
|
|
|
#[lorem
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
dolor\n|]#
|
|
|
|
dolor\n|]#
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -313,15 +291,13 @@ async fn test_extend_line() -> anyhow::Result<()> {
|
|
|
|
#[l|]#orem
|
|
|
|
#[l|]#orem
|
|
|
|
ipsum
|
|
|
|
ipsum
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"2x",
|
|
|
|
"2x",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[lorem
|
|
|
|
#[lorem
|
|
|
|
ipsum\n|]#
|
|
|
|
ipsum\n|]#
|
|
|
|
|
|
|
|
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -390,15 +366,15 @@ async fn test_character_info() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_char_backward() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_char_backward() -> anyhow::Result<()> {
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
test((
|
|
|
|
test((
|
|
|
|
platform_line("#(x|)# #[x|]#").as_str(),
|
|
|
|
platform_line("#(x|)# #[x|]#"),
|
|
|
|
"c<space><backspace><esc>",
|
|
|
|
"c<space><backspace><esc>",
|
|
|
|
platform_line("#[\n|]#").as_str(),
|
|
|
|
platform_line("#[\n|]#"),
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
test((
|
|
|
|
test((
|
|
|
|
platform_line("#( |)##( |)#a#( |)#axx#[x|]#a").as_str(),
|
|
|
|
platform_line("#( |)##( |)#a#( |)#axx#[x|]#a"),
|
|
|
|
"li<backspace><esc>",
|
|
|
|
"li<backspace><esc>",
|
|
|
|
platform_line("#(a|)##(|a)#xx#[|a]#").as_str(),
|
|
|
|
platform_line("#(a|)##(|a)#xx#[|a]#"),
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
@ -409,9 +385,9 @@ async fn test_delete_char_backward() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_word_backward() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_word_backward() -> anyhow::Result<()> {
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
test((
|
|
|
|
test((
|
|
|
|
platform_line("fo#[o|]#ba#(r|)#").as_str(),
|
|
|
|
platform_line("fo#[o|]#ba#(r|)#"),
|
|
|
|
"a<C-w><esc>",
|
|
|
|
"a<C-w><esc>",
|
|
|
|
platform_line("#[\n|]#").as_str(),
|
|
|
|
platform_line("#[\n|]#"),
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
@ -421,9 +397,9 @@ async fn test_delete_word_backward() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_word_forward() -> anyhow::Result<()> {
|
|
|
|
async fn test_delete_word_forward() -> anyhow::Result<()> {
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
// don't panic when deleting overlapping ranges
|
|
|
|
test((
|
|
|
|
test((
|
|
|
|
platform_line("fo#[o|]#b#(|ar)#").as_str(),
|
|
|
|
platform_line("fo#[o|]#b#(|ar)#"),
|
|
|
|
"i<A-d><esc>",
|
|
|
|
"i<A-d><esc>",
|
|
|
|
platform_line("fo#[\n|]#").as_str(),
|
|
|
|
platform_line("fo#[\n|]#"),
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
@ -437,16 +413,14 @@ async fn test_delete_char_forward() -> anyhow::Result<()> {
|
|
|
|
#(abc|)#ef
|
|
|
|
#(abc|)#ef
|
|
|
|
#(abc|)#f
|
|
|
|
#(abc|)#f
|
|
|
|
#(abc|)#
|
|
|
|
#(abc|)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
"a<del><esc>",
|
|
|
|
"a<del><esc>",
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
platform_line(indoc! {"\
|
|
|
|
#[abc|]#ef
|
|
|
|
#[abc|]#ef
|
|
|
|
#(abc|)#f
|
|
|
|
#(abc|)#f
|
|
|
|
#(abc|)#
|
|
|
|
#(abc|)#
|
|
|
|
#(abc|)#
|
|
|
|
#(abc|)#
|
|
|
|
"})
|
|
|
|
"}),
|
|
|
|
.as_str(),
|
|
|
|
|
|
|
|
))
|
|
|
|
))
|
|
|
|
.await?;
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
|