diff --git a/src/main.rs b/src/main.rs index 9a161e55e..809c4e6d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,8 +22,7 @@ use utils::{QuestionAction, QuestionPolicy}; const BUFFER_CAPACITY: usize = 1024 * 32; /// Current directory or empty directory -static CURRENT_DIRECTORY: Lazy = - Lazy::new(|| std::fs::canonicalize(env::current_dir().unwrap_or_default()).unwrap_or_default()); +static CURRENT_DIRECTORY: Lazy = Lazy::new(|| env::current_dir().unwrap_or_default()); /// The status code returned from `ouch` on error pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE; diff --git a/tests/ui.rs b/tests/ui.rs index 513dce7b8..c72f05224 100644 --- a/tests/ui.rs +++ b/tests/ui.rs @@ -62,12 +62,8 @@ fn ui_test_err_compress_missing_extension() { let (_dropper, dir) = testdir().unwrap(); // prepare - #[cfg(not(windows))] run_in(dir, "touch", "input").unwrap(); - #[cfg(windows)] - run_in(dir, "cmd", "/C copy nul input").unwrap(); - ui!(run_ouch("ouch compress input output", dir)); } @@ -75,15 +71,8 @@ fn ui_test_err_compress_missing_extension() { fn ui_test_err_decompress_missing_extension() { let (_dropper, dir) = testdir().unwrap(); - #[cfg(not(windows))] run_in(dir, "touch", "a b.unknown").unwrap(); - #[cfg(windows)] - run_in(dir, "cmd", "/C copy nul a").unwrap(); - - #[cfg(windows)] - run_in(dir, "cmd", "/C copy nul b.unknown").unwrap(); - ui!(run_ouch("ouch decompress a", dir)); ui!(run_ouch("ouch decompress a b.unknown", dir)); ui!(run_ouch("ouch decompress b.unknown", dir)); @@ -103,12 +92,8 @@ fn ui_test_ok_compress() { let (_dropper, dir) = testdir().unwrap(); // prepare - #[cfg(not(windows))] run_in(dir, "touch", "input").unwrap(); - #[cfg(windows)] - run_in(dir, "cmd", "/C copy nul input").unwrap(); - ui!(run_ouch("ouch compress input output.zip", dir)); ui!(run_ouch("ouch compress input output.gz", dir)); } @@ -118,7 +103,6 @@ fn ui_test_ok_decompress() { let (_dropper, dir) = testdir().unwrap(); // prepare - #[cfg(not(windows))] run_in(dir, "touch", "input").unwrap(); run_ouch("ouch compress input output.zst", dir);