Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/tests/test/auto_pairs.rs')
| -rw-r--r-- | helix-term/tests/test/auto_pairs.rs | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/helix-term/tests/test/auto_pairs.rs b/helix-term/tests/test/auto_pairs.rs index c921e2ae..e18c7119 100644 --- a/helix-term/tests/test/auto_pairs.rs +++ b/helix-term/tests/test/auto_pairs.rs @@ -2,7 +2,7 @@ use helix_core::{auto_pairs::DEFAULT_PAIRS, hashmap}; use super::*; -const LINE_END: &str = helix_core::NATIVE_LINE_ENDING.as_str(); +const LINE_END: &str = helix_core::DEFAULT_LINE_ENDING.as_str(); fn differing_pairs() -> impl Iterator<Item = &'static (char, char)> { DEFAULT_PAIRS.iter().filter(|(open, close)| open != close) @@ -19,7 +19,6 @@ async fn insert_basic() -> anyhow::Result<()> { format!("#[{}|]#", LINE_END), format!("i{}", pair.0), format!("{}#[|{}]#{}", pair.0, pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -42,23 +41,25 @@ async fn insert_configured_multi_byte_chars() -> anyhow::Result<()> { for (open, close) in pairs.iter() { test_with_config( - AppBuilder::new().with_config(config.clone()), + Args::default(), + config.clone(), + helpers::test_syntax_conf(None), ( format!("#[{}|]#", LINE_END), format!("i{}", open), format!("{}#[|{}]#{}", open, close, LINE_END), - LineFeedHandling::AsIs, ), ) .await?; test_with_config( - AppBuilder::new().with_config(config.clone()), + Args::default(), + config.clone(), + helpers::test_syntax_conf(None), ( format!("{}#[{}|]#{}", open, close, LINE_END), format!("i{}", close), format!("{}{}#[|{}]#", open, close, LINE_END), - LineFeedHandling::AsIs, ), ) .await?; @@ -74,7 +75,6 @@ async fn insert_after_word() -> anyhow::Result<()> { format!("foo#[{}|]#", LINE_END), format!("i{}", pair.0), format!("foo{}#[|{}]#{}", pair.0, pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -84,7 +84,6 @@ async fn insert_after_word() -> anyhow::Result<()> { format!("foo#[{}|]#", LINE_END), format!("i{}", pair.0), format!("foo{}#[|{}]#", pair.0, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -99,7 +98,6 @@ async fn insert_before_word() -> anyhow::Result<()> { format!("#[f|]#oo{}", LINE_END), format!("i{}", pair.0), format!("{}#[|f]#oo{}", pair.0, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -114,7 +112,6 @@ async fn insert_before_word_selection() -> anyhow::Result<()> { format!("#[foo|]#{}", LINE_END), format!("i{}", pair.0), format!("{}#[|foo]#{}", pair.0, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -129,7 +126,6 @@ async fn insert_before_word_selection_trailing_word() -> anyhow::Result<()> { format!("foo#[ wor|]#{}", LINE_END), format!("i{}", pair.0), format!("foo{}#[|{} wor]#{}", pair.0, pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -144,7 +140,6 @@ async fn insert_closer_selection_trailing_word() -> anyhow::Result<()> { format!("foo{}#[|{} wor]#{}", pair.0, pair.1, LINE_END), format!("i{}", pair.1), format!("foo{}{}#[| wor]#{}", pair.0, pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -164,7 +159,6 @@ async fn insert_before_eol() -> anyhow::Result<()> { open = pair.0, close = pair.1 ), - LineFeedHandling::AsIs, )) .await?; } @@ -176,18 +170,19 @@ async fn insert_before_eol() -> anyhow::Result<()> { async fn insert_auto_pairs_disabled() -> anyhow::Result<()> { for pair in DEFAULT_PAIRS { test_with_config( - AppBuilder::new().with_config(Config { + Args::default(), + Config { editor: helix_view::editor::Config { auto_pairs: AutoPairConfig::Enable(false), ..Default::default() }, ..Default::default() - }), + }, + helpers::test_syntax_conf(None), ( format!("#[{}|]#", LINE_END), format!("i{}", pair.0), format!("{}#[|{}]#", pair.0, LINE_END), - LineFeedHandling::AsIs, ), ) .await?; @@ -208,7 +203,6 @@ async fn insert_multi_range() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -223,7 +217,6 @@ async fn insert_before_multi_code_point_graphemes() -> anyhow::Result<()> { format!("hello #[๐จโ๐ฉโ๐งโ๐ฆ|]# goodbye{}", LINE_END), format!("i{}", pair.1), format!("hello {}#[|๐จโ๐ฉโ๐งโ๐ฆ]# goodbye{}", pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -239,7 +232,6 @@ async fn insert_at_end_of_document() -> anyhow::Result<()> { in_keys: format!("i{}", pair.0), out_text: format!("{}{}{}", LINE_END, pair.0, pair.1), out_selection: Selection::single(LINE_END.len() + 1, LINE_END.len() + 2), - line_feed_handling: LineFeedHandling::AsIs, }) .await?; @@ -249,7 +241,6 @@ async fn insert_at_end_of_document() -> anyhow::Result<()> { in_keys: format!("i{}", pair.0), out_text: format!("foo{}{}{}", LINE_END, pair.0, pair.1), out_selection: Selection::single(LINE_END.len() + 4, LINE_END.len() + 5), - line_feed_handling: LineFeedHandling::AsIs, }) .await?; } @@ -274,7 +265,6 @@ async fn insert_close_inside_pair() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -299,7 +289,6 @@ async fn insert_close_inside_pair_multi() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -324,7 +313,6 @@ async fn insert_nested_open_inside_pair() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -356,7 +344,6 @@ async fn insert_nested_open_inside_pair_multi() -> anyhow::Result<()> { inner_close = inner_pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -377,7 +364,6 @@ async fn append_basic() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -397,7 +383,6 @@ async fn append_multi_range() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -422,7 +407,6 @@ async fn append_close_inside_pair() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -447,7 +431,6 @@ async fn append_close_inside_pair_multi() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -467,7 +450,6 @@ async fn append_end_of_word() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -482,7 +464,6 @@ async fn append_middle_of_word() -> anyhow::Result<()> { format!("#[wo|]#rd{}", LINE_END), format!("a{}", pair.1), format!("#[wo{}r|]#d{}", pair.1, LINE_END), - LineFeedHandling::AsIs, )) .await?; } @@ -502,7 +483,6 @@ async fn append_end_of_word_multi() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -527,7 +507,6 @@ async fn append_inside_nested_pair() -> anyhow::Result<()> { close = pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } @@ -559,7 +538,6 @@ async fn append_inside_nested_pair_multi() -> anyhow::Result<()> { inner_close = inner_pair.1, eol = LINE_END ), - LineFeedHandling::AsIs, )) .await?; } |