aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/commands
diff options
context:
space:
mode:
authorMichael Davis2024-01-16 18:59:48 +0000
committerBlaž Hrastnik2024-01-18 01:57:53 +0000
commit1f916e65cff4459698d465b2f4558da1e1bf6e44 (patch)
tree5b6768e3069085bc5ba995efa95fdc73241ed0f6 /helix-term/tests/test/commands
parentaf8e524a7d06253fa854bf8954f64312e11d0ea0 (diff)
Create helix-stdx crate for stdlib extensions
helix-stdx is meant to carry extensions to the stdlib or low-level dependencies that are useful in all other crates. This commit starts with all of the path functions from helix-core and the CWD tracking that lived in helix-loader. The CWD tracking in helix-loader was previously unable to call the canonicalization functions in helix-core. Switching to our custom canonicalization code should make no noticeable difference though since `std::env::current_dir` returns a canonicalized path with symlinks resolved (at least on unix).
Diffstat (limited to 'helix-term/tests/test/commands')
-rw-r--r--helix-term/tests/test/commands/write.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/helix-term/tests/test/commands/write.rs b/helix-term/tests/test/commands/write.rs
index 376ba5e7..adc721c5 100644
--- a/helix-term/tests/test/commands/write.rs
+++ b/helix-term/tests/test/commands/write.rs
@@ -3,7 +3,8 @@ use std::{
ops::RangeInclusive,
};
-use helix_core::{diagnostic::Severity, path::get_normalized_path};
+use helix_core::diagnostic::Severity;
+use helix_stdx::path;
use helix_view::doc;
use super::*;
@@ -23,7 +24,7 @@ async fn test_write_quit_fail() -> anyhow::Result<()> {
assert_eq!(1, docs.len());
let doc = docs.pop().unwrap();
- assert_eq!(Some(&get_normalized_path(file.path())), doc.path());
+ assert_eq!(Some(&path::normalize(file.path())), doc.path());
assert_eq!(&Severity::Error, app.editor.get_status().unwrap().1);
}),
false,
@@ -269,7 +270,7 @@ async fn test_write_scratch_to_new_path() -> anyhow::Result<()> {
assert_eq!(1, docs.len());
let doc = docs.pop().unwrap();
- assert_eq!(Some(&get_normalized_path(file.path())), doc.path());
+ assert_eq!(Some(&path::normalize(file.path())), doc.path());
}),
false,
)
@@ -341,7 +342,7 @@ async fn test_write_new_path() -> anyhow::Result<()> {
Some(&|app| {
let doc = doc!(app.editor);
assert!(!app.editor.is_err());
- assert_eq!(&get_normalized_path(file1.path()), doc.path().unwrap());
+ assert_eq!(&path::normalize(file1.path()), doc.path().unwrap());
}),
),
(
@@ -349,7 +350,7 @@ async fn test_write_new_path() -> anyhow::Result<()> {
Some(&|app| {
let doc = doc!(app.editor);
assert!(!app.editor.is_err());
- assert_eq!(&get_normalized_path(file2.path()), doc.path().unwrap());
+ assert_eq!(&path::normalize(file2.path()), doc.path().unwrap());
assert!(app.editor.document_by_path(file1.path()).is_none());
}),
),