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.rs | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/helix-term/tests/test/splits.rs b/helix-term/tests/test/splits.rs index 3ba5a504..1d70f24a 100644 --- a/helix-term/tests/test/splits.rs +++ b/helix-term/tests/test/splits.rs @@ -1,6 +1,6 @@ use super::*; -use helix_stdx::path; +use helix_core::path::get_normalized_path; #[tokio::test(flavor = "multi_thread")] async fn test_split_write_quit_all() -> anyhow::Result<()> { @@ -27,21 +27,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() == &get_normalized_path(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() == &get_normalized_path(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() == &get_normalized_path(file3.path())) .unwrap(); assert_eq!("hello3", doc3.text().to_string()); @@ -62,9 +62,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 +91,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 +110,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 +122,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 +151,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 +160,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 +185,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?; |