mirror of
https://github.com/ouch-org/ouch.git
synced 2025-07-22 01:20:24 +00:00
zst is not an archive format..
This commit is contained in:
parent
0ed6841865
commit
bdf5090844
@ -11,7 +11,7 @@ use zip::{self, read::ZipFile, ZipArchive};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
info,
|
info,
|
||||||
utils::{self, dir_is_empty,strip_cur_dir, Bytes},
|
utils::{self, dir_is_empty, strip_cur_dir, Bytes},
|
||||||
};
|
};
|
||||||
|
|
||||||
use self::utf8::get_invalid_utf8_paths;
|
use self::utf8::get_invalid_utf8_paths;
|
||||||
|
@ -21,7 +21,7 @@ pub enum CompressionFormat {
|
|||||||
|
|
||||||
impl CompressionFormat {
|
impl CompressionFormat {
|
||||||
pub fn is_archive_format(&self) -> bool {
|
pub fn is_archive_format(&self) -> bool {
|
||||||
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zstd | Zip)
|
matches!(self, Tar | Tgz | Tbz | Tlzma | Tzst | Zip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ fn sanity_check_through_mime() {
|
|||||||
|
|
||||||
let formats = [
|
let formats = [
|
||||||
"tar", "zip", "tar.gz", "tgz", "tbz", "tbz2", "txz", "tlz", "tlzma", "tzst", "tar.bz", "tar.bz2", "tar.lzma",
|
"tar", "zip", "tar.gz", "tgz", "tbz", "tbz2", "txz", "tlz", "tlzma", "tzst", "tar.bz", "tar.bz2", "tar.lzma",
|
||||||
"tar.xz", "zst",
|
"tar.xz", "tar.zst",
|
||||||
];
|
];
|
||||||
|
|
||||||
let expected_mimes = [
|
let expected_mimes = [
|
||||||
@ -79,6 +79,7 @@ fn test_each_format() {
|
|||||||
test_compressing_and_decompressing_archive("tar.xz");
|
test_compressing_and_decompressing_archive("tar.xz");
|
||||||
test_compressing_and_decompressing_archive("tar.lz");
|
test_compressing_and_decompressing_archive("tar.lz");
|
||||||
test_compressing_and_decompressing_archive("tar.lzma");
|
test_compressing_and_decompressing_archive("tar.lzma");
|
||||||
|
test_compressing_and_decompressing_archive("tar.zst");
|
||||||
test_compressing_and_decompressing_archive("tgz");
|
test_compressing_and_decompressing_archive("tgz");
|
||||||
test_compressing_and_decompressing_archive("tbz");
|
test_compressing_and_decompressing_archive("tbz");
|
||||||
test_compressing_and_decompressing_archive("tbz2");
|
test_compressing_and_decompressing_archive("tbz2");
|
||||||
@ -96,7 +97,7 @@ fn test_each_format() {
|
|||||||
|
|
||||||
// Why not
|
// Why not
|
||||||
test_compressing_and_decompressing_archive(
|
test_compressing_and_decompressing_archive(
|
||||||
"tar.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz",
|
"tar.gz.gz.gz.gz.gz.gz.gz.gz.zst.gz.gz.gz.gz.gz.gz.gz.gz.gz.gz.lz.lz.lz.lz.lz.lz.lz.lz.lz.lz.bz.bz.bz.bz.bz.bz.bz",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user