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

Merge branch 'main' into rm-correct-prompts

This commit is contained in:
Sylvestre Ledru 2022-10-22 10:22:29 +02:00 committed by GitHub
commit fd13ceddcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 171 additions and 118 deletions

View file

@ -1,5 +1,5 @@
use crate::common::util::*;
// spell-checker:ignore checkfile, nonames, testf
// spell-checker:ignore checkfile, nonames, testf, ntestf
macro_rules! get_hash(
($str:expr) => (
$str.split(' ').collect::<Vec<&str>>()[0]
@ -117,6 +117,26 @@ fn test_check_sha1() {
.stderr_is("");
}
#[test]
fn test_check_file_not_found_warning() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.write("testf", "foobar\n");
at.write(
"testf.sha1",
"988881adc9fc3655077dc2d4d757d480b5ea0e11 testf\n",
);
at.remove("testf");
scene
.ccmd("sha1sum")
.arg("-c")
.arg(at.subdir.join("testf.sha1"))
.succeeds()
.stdout_is("sha1sum: testf: No such file or directory\ntestf: FAILED open or read\n")
.stderr_is("sha1sum: warning: 1 listed file could not be read");
}
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);

View file

@ -966,7 +966,7 @@ fn test_ls_long() {
result.stdout_matches(&Regex::new(r"[-bcCdDlMnpPsStTx?]([r-][w-][xt-]){3}.*").unwrap());
#[cfg(windows)]
result.stdout_contains("---------- 1 somebody somegroup");
result.stdout_matches(&Regex::new(r"[-dl](r[w-]x){3}.*").unwrap());
}
}