Skip to content

Commit

Permalink
distinct crlf and lf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
woojiq committed Aug 30, 2023
1 parent 2ee32ac commit 84cd92a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion helix-term/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(feature = "integration")]
// #[cfg(feature = "integration")]
mod test {
mod helpers;

Expand Down
40 changes: 24 additions & 16 deletions helix-term/tests/test/movement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,14 @@ async fn previous_occurrence_of_char() -> anyhow::Result<()> {
use helix_term::config::Config;
use helix_view::editor::LineEndingConfig;

let mut config = Config::default();
config.editor.default_line_ending = LineEndingConfig::Crlf;
let mut config_crlf = Config::default();
config_crlf.editor.default_line_ending = LineEndingConfig::Crlf;
let mut config_lf = Config::default();
config_lf.editor.default_line_ending = LineEndingConfig::LF;

// Move till previous char occurrence should properly handle <ret> when line-ending is Crlf
test_with_config(
AppBuilder::new().with_config(config.clone()),
AppBuilder::new().with_config(config_crlf.clone()),
(
"text\r\nnext #[l|]#ine",
"T<ret>",
Expand All @@ -534,16 +536,19 @@ async fn previous_occurrence_of_char() -> anyhow::Result<()> {
),
)
.await?;
test((
"text\nnext #[l|]#ine",
"T<ret>",
"text\n#[|next l]#ine",
"Move till previous LF",
))
test_with_config(
AppBuilder::new().with_config(config_lf.clone()),
(
"text\nnext #[l|]#ine",
"T<ret>",
"text\n#[|next l]#ine",
"Move till previous LF",
),
)
.await?;

test_with_config(
AppBuilder::new().with_config(config),
AppBuilder::new().with_config(config_crlf),
(
"text\r\nnext #[l|]#ine",
"F<ret>",
Expand All @@ -552,12 +557,15 @@ async fn previous_occurrence_of_char() -> anyhow::Result<()> {
),
)
.await?;
test((
"text\nnext #[l|]#ine",
"F<ret>",
"text#[|\nnext l]#ine",
"Move to previous LF",
))
test_with_config(
AppBuilder::new().with_config(config_lf),
(
"text\nnext #[l|]#ine",
"F<ret>",
"text#[|\nnext l]#ine",
"Move to previous LF",
),
)
.await?;

Ok(())
Expand Down

0 comments on commit 84cd92a

Please sign in to comment.