1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Refactor(split) - migrate from getopts to clap (#1712)

This commit is contained in:
Felipe Lema 2021-02-11 16:45:23 -03:00 committed by GitHub
parent 51383e10e6
commit 35a7f01d15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 157 additions and 111 deletions

View file

@ -112,12 +112,17 @@ fn test_split_default() {
}
#[test]
fn test_split_num_prefixed_chunks_by_bytes() {
fn test_split_numeric_prefixed_chunks_by_bytes() {
let (at, mut ucmd) = at_and_ucmd!();
let name = "split_num_prefixed_chunks_by_bytes";
let glob = Glob::new(&at, ".", r"a\d\d$");
RandomFile::new(&at, name).add_bytes(10000);
ucmd.args(&["-d", "-b", "1000", name, "a"]).succeeds();
ucmd.args(&[
"-d", // --numeric-suffixes
"-b", // --bytes
"1000", name, "a",
])
.succeeds();
assert_eq!(glob.count(), 10);
assert_eq!(glob.collate(), at.read(name).into_bytes());
}