1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Merge branch 'main' into hotfix-mktemp

This commit is contained in:
Zaú Júlio 2023-02-25 18:37:22 -03:00 committed by GitHub
commit be2b7032f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 1199 additions and 635 deletions

View file

@ -650,3 +650,24 @@ fn test_chmod_file_symlink_after_non_existing_file() {
0o100764
);
}
#[test]
fn test_quiet_n_verbose_used_multiple_times() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.touch("file");
scene
.ucmd()
.arg("u+x")
.arg("--verbose")
.arg("--verbose")
.arg("file")
.succeeds();
scene
.ucmd()
.arg("u+x")
.arg("--quiet")
.arg("--quiet")
.arg("file")
.succeeds();
}

View file

@ -114,3 +114,79 @@ fn test_stdin_larger_than_128_bytes() {
assert_eq!(cksum, 945_881_979);
assert_eq!(bytes_cnt, 2058);
}
#[test]
fn test_sha1_single_file() {
new_ucmd!()
.arg("-a=sha1")
.arg("lorem_ipsum.txt")
.succeeds()
.stdout_is("ab1dd0bae1d8883a3d18a66de6afbd28252cfbef 772 lorem_ipsum.txt\n");
}
#[test]
fn test_sm3_single_file() {
new_ucmd!()
.arg("-a=sm3")
.arg("lorem_ipsum.txt")
.succeeds()
.stdout_is(
"6d296b805d060bfed22808df308dbb9b4317794dd4ed6740a10770a782699bc2 772 lorem_ipsum.txt\n",
);
}
#[test]
fn test_bsd_single_file() {
new_ucmd!()
.arg("-a=bsd")
.arg("lorem_ipsum.txt")
.succeeds()
.stdout_only_fixture("bsd_single_file.expected");
}
#[test]
fn test_bsd_multiple_files() {
new_ucmd!()
.arg("-a=bsd")
.arg("lorem_ipsum.txt")
.arg("alice_in_wonderland.txt")
.succeeds()
.stdout_only_fixture("bsd_multiple_files.expected");
}
#[test]
fn test_bsd_stdin() {
new_ucmd!()
.arg("-a=bsd")
.pipe_in_fixture("lorem_ipsum.txt")
.succeeds()
.stdout_only_fixture("bsd_stdin.expected");
}
#[test]
fn test_sysv_single_file() {
new_ucmd!()
.arg("-a=sysv")
.arg("lorem_ipsum.txt")
.succeeds()
.stdout_only_fixture("sysv_single_file.expected");
}
#[test]
fn test_sysv_multiple_files() {
new_ucmd!()
.arg("-a=sysv")
.arg("lorem_ipsum.txt")
.arg("alice_in_wonderland.txt")
.succeeds()
.stdout_only_fixture("sysv_multiple_files.expected");
}
#[test]
fn test_sysv_stdin() {
new_ucmd!()
.arg("-a=sysv")
.pipe_in_fixture("lorem_ipsum.txt")
.succeeds()
.stdout_only_fixture("sysv_stdin.expected");
}

View file

@ -121,6 +121,14 @@ fn test_invalid_signal() {
.usage_error("'invalid': invalid signal");
}
#[test]
fn test_invalid_multi_byte_characters() {
new_ucmd!()
.args(&["10€", "sleep", "0"])
.fails()
.usage_error("invalid time interval '10€'");
}
/// Test that the long form of the `--kill-after` argument is recognized.
#[test]
fn test_kill_after_long() {

View file

@ -0,0 +1,2 @@
08109 1 lorem_ipsum.txt
01814 1 alice_in_wonderland.txt

View file

@ -0,0 +1 @@
08109 1 lorem_ipsum.txt

View file

@ -0,0 +1 @@
08109 1

View file

@ -0,0 +1,2 @@
6985 2 lorem_ipsum.txt
27441 1 alice_in_wonderland.txt

View file

@ -0,0 +1 @@
6985 2 lorem_ipsum.txt

View file

@ -0,0 +1 @@
6985 2