diff options
author | Daniel Hofstetter <daniel.hofstetter@42dh.com> | 2024-07-03 09:48:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-03 09:48:08 +0200 |
commit | a18c1329947468e25680d4509affb1b760e575b0 (patch) | |
tree | 713e7f6d8f0a9df8d0083292497bbfc289041217 /tests/by-util | |
parent | 14230e3c6820d5b24bf099b46d28cb9d5d7120da (diff) | |
parent | a6c5ee576a7e40ca2e933767355eb96776114f26 (diff) |
Merge pull request #6524 from sylvestre/cksum-3
cksum: read the next file when the first is missing or invalid
Diffstat (limited to 'tests/by-util')
-rw-r--r-- | tests/by-util/test_cksum.rs | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/by-util/test_cksum.rs b/tests/by-util/test_cksum.rs index d1a0d224e..b2aafc2cb 100644 --- a/tests/by-util/test_cksum.rs +++ b/tests/by-util/test_cksum.rs @@ -2,7 +2,7 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore (words) asdf algo algos +// spell-checker:ignore (words) asdf algo algos mgmt use crate::common::util::TestScenario; @@ -1221,3 +1221,32 @@ fn test_check_base64_hashes() { .succeeds() .stdout_is("empty: OK\nempty: OK\nempty: OK\n"); } + +#[test] +fn test_several_files_error_mgmt() { + let scene = TestScenario::new(util_name!()); + let at = &scene.fixtures; + + // don't exist + scene + .ucmd() + .arg("--check") + .arg("empty") + .arg("incorrect") + .fails() + .stderr_contains("empty: No such file ") + .stderr_contains("incorrect: No such file "); + + at.touch("empty"); + at.touch("incorrect"); + + // exists but incorrect + scene + .ucmd() + .arg("--check") + .arg("empty") + .arg("incorrect") + .fails() + .stderr_contains("empty: no properly ") + .stderr_contains("incorrect: no properly "); +} |