Skip to content

Commit

Permalink
Removing redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19 committed Nov 26, 2023
1 parent 3377f5b commit 4374c9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 0 additions & 16 deletions tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,17 @@ 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));
}

#[test]
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));
Expand All @@ -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));
}
Expand All @@ -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);

Expand Down

0 comments on commit 4374c9b

Please sign in to comment.