Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/tests/test/splits.rs')
-rw-r--r--helix-term/tests/test/splits.rs33
1 files changed, 13 insertions, 20 deletions
diff --git a/helix-term/tests/test/splits.rs b/helix-term/tests/test/splits.rs
index 3ba5a504..96ced21a 100644
--- a/helix-term/tests/test/splits.rs
+++ b/helix-term/tests/test/splits.rs
@@ -1,7 +1,5 @@
use super::*;
-use helix_stdx::path;
-
#[tokio::test(flavor = "multi_thread")]
async fn test_split_write_quit_all() -> anyhow::Result<()> {
let mut file1 = tempfile::NamedTempFile::new()?;
@@ -27,21 +25,21 @@ async fn test_split_write_quit_all() -> anyhow::Result<()> {
let doc1 = docs
.iter()
- .find(|doc| doc.path().unwrap() == &path::normalize(file1.path()))
+ .find(|doc| doc.path().unwrap() == file1.path())
.unwrap();
assert_eq!("hello1", doc1.text().to_string());
let doc2 = docs
.iter()
- .find(|doc| doc.path().unwrap() == &path::normalize(file2.path()))
+ .find(|doc| doc.path().unwrap() == file2.path())
.unwrap();
assert_eq!("hello2", doc2.text().to_string());
let doc3 = docs
.iter()
- .find(|doc| doc.path().unwrap() == &path::normalize(file3.path()))
+ .find(|doc| doc.path().unwrap() == file3.path())
.unwrap();
assert_eq!("hello3", doc3.text().to_string());
@@ -62,9 +60,9 @@ async fn test_split_write_quit_all() -> anyhow::Result<()> {
)
.await?;
- helpers::assert_file_has_content(&mut file1, &LineFeedHandling::Native.apply("hello1"))?;
- helpers::assert_file_has_content(&mut file2, &LineFeedHandling::Native.apply("hello2"))?;
- helpers::assert_file_has_content(&mut file3, &LineFeedHandling::Native.apply("hello3"))?;
+ helpers::assert_file_has_content(file1.as_file_mut(), "hello1")?;
+ helpers::assert_file_has_content(file2.as_file_mut(), "hello2")?;
+ helpers::assert_file_has_content(file3.as_file_mut(), "hello3")?;
Ok(())
}
@@ -91,7 +89,7 @@ async fn test_split_write_quit_same_file() -> anyhow::Result<()> {
let doc = docs.pop().unwrap();
assert_eq!(
- LineFeedHandling::Native.apply("hello\ngoodbye"),
+ helpers::platform_line("hello\ngoodbye"),
doc.text().to_string()
);
@@ -110,7 +108,7 @@ async fn test_split_write_quit_same_file() -> anyhow::Result<()> {
let doc = docs.pop().unwrap();
assert_eq!(
- LineFeedHandling::Native.apply("hello\ngoodbye"),
+ helpers::platform_line("hello\ngoodbye"),
doc.text().to_string()
);
@@ -122,7 +120,10 @@ async fn test_split_write_quit_same_file() -> anyhow::Result<()> {
)
.await?;
- helpers::assert_file_has_content(&mut file, &LineFeedHandling::Native.apply("hello\ngoodbye"))?;
+ helpers::assert_file_has_content(
+ file.as_file_mut(),
+ &helpers::platform_line("hello\ngoodbye"),
+ )?;
Ok(())
}
@@ -148,13 +149,7 @@ async fn test_changes_in_splits_apply_to_all_views() -> anyhow::Result<()> {
//
// This panicked in the past because the jumplist entry on line 2 of window 2
// was not updated and after the `kd` step, pointed outside of the document.
- test((
- "#[|]#",
- "<C-w>v[<space><C-s><C-w>wkd<C-w>qd",
- "#[|]#",
- LineFeedHandling::AsIs,
- ))
- .await?;
+ test(("#[|]#", "<C-w>v[<space><C-s><C-w>wkd<C-w>qd", "#[|]#")).await?;
// Transactions are applied to the views for windows lazily when they are focused.
// This case panics if the transactions and inversions are not applied in the
@@ -163,7 +158,6 @@ async fn test_changes_in_splits_apply_to_all_views() -> anyhow::Result<()> {
"#[|]#",
"[<space>[<space>[<space><C-w>vuuu<C-w>wUUU<C-w>quuu",
"#[|]#",
- LineFeedHandling::AsIs,
))
.await?;
@@ -189,7 +183,6 @@ async fn test_changes_in_splits_apply_to_all_views() -> anyhow::Result<()> {
"#[|]#",
"3[<space><C-w>v<C-s><C-w>wuu3[<space><C-w>q%d",
"#[|]#",
- LineFeedHandling::AsIs,
))
.await?;