mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
Removing redundant code
This commit is contained in:
parent
8483739184
commit
d07c65508a
@ -22,8 +22,7 @@ use utils::{QuestionAction, QuestionPolicy};
|
||||
const BUFFER_CAPACITY: usize = 1024 * 32;
|
||||
|
||||
/// Current directory or empty directory
|
||||
static CURRENT_DIRECTORY: Lazy<PathBuf> =
|
||||
Lazy::new(|| std::fs::canonicalize(env::current_dir().unwrap_or_default()).unwrap_or_default());
|
||||
static CURRENT_DIRECTORY: Lazy<PathBuf> = Lazy::new(|| env::current_dir().unwrap_or_default());
|
||||
|
||||
/// The status code returned from `ouch` on error
|
||||
pub const EXIT_FAILURE: i32 = libc::EXIT_FAILURE;
|
||||
|
16
tests/ui.rs
16
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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user