Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 7z support, fix windows specific symlink issue and UI tests #555

Merged
merged 23 commits into from
Nov 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removing redundant code
marcospb19 committed Nov 26, 2023
commit 4374c9b53f10a48329ee7ffdf7b0adb74bd2d2c3
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 0 additions & 16 deletions tests/ui.rs
Original file line number Diff line number Diff line change
@@ -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));
@@ -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);