From 0798cfe155419c827194b0cf940ed0b5f3fa3191 Mon Sep 17 00:00:00 2001 From: Marras Antoine Date: Mon, 10 Apr 2023 20:27:49 +0200 Subject: [PATCH] b2sum: added test for length option --- tests/by-util/test_hashsum.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/by-util/test_hashsum.rs b/tests/by-util/test_hashsum.rs index a227b9fc3..55bef3792 100644 --- a/tests/by-util/test_hashsum.rs +++ b/tests/by-util/test_hashsum.rs @@ -125,6 +125,23 @@ fn test_check_sha1() { .stderr_is(""); } +#[test] +fn test_check_b2sum_length_option() { + let scene = TestScenario::new(util_name!()); + let at = &scene.fixtures; + + at.write("testf", "foobar\n"); + at.write("testf.b2sum", "6a testf\n"); + + scene + .ccmd("b2sum") + .arg("--length=8") + .arg("-c") + .arg(at.subdir.join("testf.b2sum")) + .succeeds() + .stdout_only("testf: OK\n"); +} + #[test] fn test_check_file_not_found_warning() { let scene = TestScenario::new(util_name!());