mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
update snapshots
This commit is contained in:
parent
09899389ec
commit
3d717ec3bc
@ -11,4 +11,3 @@ hint: ouch compress <FILES>... output.zip
|
|||||||
hint:
|
hint:
|
||||||
hint: Alternatively, you can overwrite this option by using the '--format' flag:
|
hint: Alternatively, you can overwrite this option by using the '--format' flag:
|
||||||
hint: ouch compress <FILES>... output --format tar.gz
|
hint: ouch compress <FILES>... output --format tar.gz
|
||||||
|
|
||||||
|
@ -11,4 +11,3 @@ hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
|||||||
hint:
|
hint:
|
||||||
hint: Alternatively, you can pass an extension to the '--format' flag:
|
hint: Alternatively, you can pass an extension to the '--format' flag:
|
||||||
hint: ouch decompress <TMP_DIR>/a --format tar.gz
|
hint: ouch decompress <TMP_DIR>/a --format tar.gz
|
||||||
|
|
||||||
|
@ -9,4 +9,3 @@ expression: "run_ouch(\"ouch decompress a b.unknown\", dir)"
|
|||||||
|
|
||||||
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, rar, 7z
|
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, rar, 7z
|
||||||
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
||||||
|
|
||||||
|
@ -11,4 +11,3 @@ hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
|||||||
hint:
|
hint:
|
||||||
hint: Alternatively, you can pass an extension to the '--format' flag:
|
hint: Alternatively, you can pass an extension to the '--format' flag:
|
||||||
hint: ouch decompress <TMP_DIR>/b.unknown --format tar.gz
|
hint: ouch decompress <TMP_DIR>/b.unknown --format tar.gz
|
||||||
|
|
||||||
|
@ -11,4 +11,3 @@ hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
|||||||
hint:
|
hint:
|
||||||
hint: Alternatively, you can pass an extension to the '--format' flag:
|
hint: Alternatively, you can pass an extension to the '--format' flag:
|
||||||
hint: ouch decompress <TMP_DIR>/a --format tar.gz
|
hint: ouch decompress <TMP_DIR>/a --format tar.gz
|
||||||
|
|
||||||
|
@ -9,4 +9,3 @@ expression: "run_ouch(\"ouch decompress a b.unknown\", dir)"
|
|||||||
|
|
||||||
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, 7z
|
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, 7z
|
||||||
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
||||||
|
|
||||||
|
@ -11,4 +11,3 @@ hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
|||||||
hint:
|
hint:
|
||||||
hint: Alternatively, you can pass an extension to the '--format' flag:
|
hint: Alternatively, you can pass an extension to the '--format' flag:
|
||||||
hint: ouch decompress <TMP_DIR>/b.unknown --format tar.gz
|
hint: ouch decompress <TMP_DIR>/b.unknown --format tar.gz
|
||||||
|
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
source: tests/ui.rs
|
||||||
|
expression: "run_ouch(\"ouch compress input output --format tar.gz.unknown\", dir)"
|
||||||
|
---
|
||||||
|
[ERROR] Failed to parse `--format tar.gz.unknown`
|
||||||
|
- Unsupported extension 'unknown'
|
||||||
|
|
||||||
|
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, 7z
|
||||||
|
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
||||||
|
hint:
|
||||||
|
hint: Examples:
|
||||||
|
hint: --format tar
|
||||||
|
hint: --format gz
|
||||||
|
hint: --format tar.gz
|
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
source: tests/ui.rs
|
||||||
|
expression: "run_ouch(\"ouch compress input output --format targz\", dir)"
|
||||||
|
---
|
||||||
|
[ERROR] Failed to parse `--format targz`
|
||||||
|
- Unsupported extension 'targz'
|
||||||
|
|
||||||
|
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, 7z
|
||||||
|
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
||||||
|
hint:
|
||||||
|
hint: Examples:
|
||||||
|
hint: --format tar
|
||||||
|
hint: --format gz
|
||||||
|
hint: --format tar.gz
|
@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
source: tests/ui.rs
|
||||||
|
expression: "run_ouch(\"ouch compress input output --format .tar.$#!@.rest\", dir)"
|
||||||
|
---
|
||||||
|
[ERROR] Failed to parse `--format .tar.$#!@.rest`
|
||||||
|
- Unsupported extension '$#!@'
|
||||||
|
|
||||||
|
hint: Supported extensions are: tar, zip, bz, bz2, gz, lz4, xz, lzma, sz, zst, 7z
|
||||||
|
hint: Supported aliases are: tgz, tbz, tlz4, txz, tzlma, tsz, tzst
|
||||||
|
hint:
|
||||||
|
hint: Examples:
|
||||||
|
hint: --format tar
|
||||||
|
hint: --format gz
|
||||||
|
hint: --format tar.gz
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch decompress a b\", dir)"
|
|||||||
---
|
---
|
||||||
[ERROR] failed to canonicalize path `a`
|
[ERROR] failed to canonicalize path `a`
|
||||||
- File not found
|
- File not found
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch list a b\", dir)"
|
|||||||
---
|
---
|
||||||
[ERROR] failed to canonicalize path `a`
|
[ERROR] failed to canonicalize path `a`
|
||||||
- File not found
|
- File not found
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch compress a b\", dir)"
|
|||||||
---
|
---
|
||||||
[ERROR] failed to canonicalize path `a`
|
[ERROR] failed to canonicalize path `a`
|
||||||
- File not found
|
- File not found
|
||||||
|
|
||||||
|
@ -3,4 +3,3 @@ source: tests/ui.rs
|
|||||||
expression: "run_ouch(\"ouch compress input output.gz\", dir)"
|
expression: "run_ouch(\"ouch compress input output.gz\", dir)"
|
||||||
---
|
---
|
||||||
[INFO] Successfully compressed 'output.gz'.
|
[INFO] Successfully compressed 'output.gz'.
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch compress input output.zip\", dir)"
|
|||||||
---
|
---
|
||||||
[INFO] Compressing 'input'.
|
[INFO] Compressing 'input'.
|
||||||
[INFO] Successfully compressed 'output.zip'.
|
[INFO] Successfully compressed 'output.zip'.
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch decompress output.zst\", dir)"
|
|||||||
---
|
---
|
||||||
[INFO] Successfully decompressed archive in current directory.
|
[INFO] Successfully decompressed archive in current directory.
|
||||||
[INFO] Files unpacked: 1
|
[INFO] Files unpacked: 1
|
||||||
|
|
||||||
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch compress input output1 --format tar.gz\", dir)"
|
|||||||
---
|
---
|
||||||
[INFO] Compressing 'input'.
|
[INFO] Compressing 'input'.
|
||||||
[INFO] Successfully compressed 'output1'.
|
[INFO] Successfully compressed 'output1'.
|
||||||
|
|
@ -4,4 +4,3 @@ expression: "run_ouch(\"ouch compress input output2 --format .tar.gz\", dir)"
|
|||||||
---
|
---
|
||||||
[INFO] Compressing 'input'.
|
[INFO] Compressing 'input'.
|
||||||
[INFO] Successfully compressed 'output2'.
|
[INFO] Successfully compressed 'output2'.
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
source: tests/ui.rs
|
||||||
|
expression: "run_ouch(\"ouch compress input output1 --format tar.gz\", dir)"
|
||||||
|
---
|
||||||
|
[INFO] Compressing 'input'.
|
||||||
|
[INFO] Successfully compressed 'output1'.
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
source: tests/ui.rs
|
||||||
|
expression: "run_ouch(\"ouch compress input output2 --format .tar.gz\", dir)"
|
||||||
|
---
|
||||||
|
[INFO] Compressing 'input'.
|
||||||
|
[INFO] Successfully compressed 'output2'.
|
@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
source: tests/ui.rs
|
source: tests/ui.rs
|
||||||
assertion_line: 119
|
|
||||||
expression: "output_to_string(ouch!(\"-h\"))"
|
expression: "output_to_string(ouch!(\"-h\"))"
|
||||||
---
|
---
|
||||||
A command-line utility for easily compressing and decompressing files and directories.
|
A command-line utility for easily compressing and decompressing files and directories.
|
||||||
|
@ -48,4 +48,3 @@ Options:
|
|||||||
|
|
||||||
-V, --version
|
-V, --version
|
||||||
Print version
|
Print version
|
||||||
|
|
||||||
|
53
tests/ui.rs
53
tests/ui.rs
@ -65,17 +65,10 @@ fn ui_test_err_decompress_missing_extension() {
|
|||||||
|
|
||||||
create_files_in(dir, &["a", "b.unknown"]);
|
create_files_in(dir, &["a", "b.unknown"]);
|
||||||
|
|
||||||
let name = {
|
let snapshot = concat_snapshot_filename_rar_feature("ui_test_err_decompress_missing_extension");
|
||||||
let suffix = if cfg!(feature = "unrar") {
|
ui!(format!("{snapshot}-1"), run_ouch("ouch decompress a", dir));
|
||||||
"with_rar"
|
ui!(format!("{snapshot}-2"), run_ouch("ouch decompress a b.unknown", dir));
|
||||||
} else {
|
ui!(format!("{snapshot}-3"), run_ouch("ouch decompress b.unknown", dir));
|
||||||
"without_rar"
|
|
||||||
};
|
|
||||||
format!("ui_test_err_decompress_missing_extension_{suffix}")
|
|
||||||
};
|
|
||||||
ui!(format!("{name}-1"), run_ouch("ouch decompress a", dir));
|
|
||||||
ui!(format!("{name}-2"), run_ouch("ouch decompress a b.unknown", dir));
|
|
||||||
ui!(format!("{name}-3"), run_ouch("ouch decompress b.unknown", dir));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -94,9 +87,19 @@ fn ui_test_err_format_flag() {
|
|||||||
// prepare
|
// prepare
|
||||||
create_files_in(dir, &["input"]);
|
create_files_in(dir, &["input"]);
|
||||||
|
|
||||||
ui!(run_ouch("ouch compress input output --format tar.gz.unknown", dir));
|
let snapshot = concat_snapshot_filename_rar_feature("ui_test_err_format_flag");
|
||||||
ui!(run_ouch("ouch compress input output --format targz", dir));
|
ui!(
|
||||||
ui!(run_ouch("ouch compress input output --format .tar.$#!@.rest", dir));
|
format!("{snapshot}-1"),
|
||||||
|
run_ouch("ouch compress input output --format tar.gz.unknown", dir),
|
||||||
|
);
|
||||||
|
ui!(
|
||||||
|
format!("{snapshot}-2"),
|
||||||
|
run_ouch("ouch compress input output --format targz", dir),
|
||||||
|
);
|
||||||
|
ui!(
|
||||||
|
format!("{snapshot}-3"),
|
||||||
|
run_ouch("ouch compress input output --format .tar.$#!@.rest", dir),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -106,8 +109,15 @@ fn ui_test_ok_format_flag() {
|
|||||||
// prepare
|
// prepare
|
||||||
create_files_in(dir, &["input"]);
|
create_files_in(dir, &["input"]);
|
||||||
|
|
||||||
ui!(run_ouch("ouch compress input output1 --format tar.gz", dir));
|
let snapshot = concat_snapshot_filename_rar_feature("ui_test_ok_format_flag");
|
||||||
ui!(run_ouch("ouch compress input output2 --format .tar.gz", dir));
|
ui!(
|
||||||
|
format!("{snapshot}-1"),
|
||||||
|
run_ouch("ouch compress input output1 --format tar.gz", dir),
|
||||||
|
);
|
||||||
|
ui!(
|
||||||
|
format!("{snapshot}-2"),
|
||||||
|
run_ouch("ouch compress input output2 --format .tar.gz", dir),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -142,3 +152,14 @@ fn ui_test_usage_help_flag() {
|
|||||||
ui!(output_to_string(ouch!("-h")));
|
ui!(output_to_string(ouch!("-h")));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Concatenates `with_rar` or `without_rar` if the feature is toggled or not.
|
||||||
|
fn concat_snapshot_filename_rar_feature(name: &str) -> String {
|
||||||
|
let suffix = if cfg!(feature = "unrar") {
|
||||||
|
"with_rar"
|
||||||
|
} else {
|
||||||
|
"without_rar"
|
||||||
|
};
|
||||||
|
|
||||||
|
format!("{name}_{suffix}")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user