mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
hashsum: change debug to display format with --tag
This commit is contained in:
parent
bd82d678ef
commit
93a54f36f3
2 changed files with 17 additions and 1 deletions
|
@ -744,7 +744,7 @@ where
|
||||||
)
|
)
|
||||||
.map_err_context(|| "failed to read input".to_string())?;
|
.map_err_context(|| "failed to read input".to_string())?;
|
||||||
if options.tag {
|
if options.tag {
|
||||||
println!("{} ({:?}) = {}", options.algoname, filename.display(), sum);
|
println!("{} ({}) = {}", options.algoname, filename.display(), sum);
|
||||||
} else if options.nonames {
|
} else if options.nonames {
|
||||||
println!("{sum}");
|
println!("{sum}");
|
||||||
} else if options.zero {
|
} else if options.zero {
|
||||||
|
|
|
@ -355,3 +355,19 @@ fn test_check_md5sum_mixed_format() {
|
||||||
fn test_invalid_arg() {
|
fn test_invalid_arg() {
|
||||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_tag() {
|
||||||
|
let scene = TestScenario::new(util_name!());
|
||||||
|
let at = &scene.fixtures;
|
||||||
|
|
||||||
|
at.write("foobar", "foo bar\n");
|
||||||
|
scene
|
||||||
|
.ccmd("sha256sum")
|
||||||
|
.arg("--tag")
|
||||||
|
.arg("foobar")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is(
|
||||||
|
"SHA256 (foobar) = 1f2ec52b774368781bed1d1fb140a92e0eb6348090619c9291f9a5a3c8e8d151\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue