mirror of
https://github.com/BLAKE3-team/BLAKE3
synced 2024-03-28 18:39:56 +01:00
suppress expected stderr prints in b3sum tests
This commit is contained in:
parent
4c51c06008
commit
697ca13550
|
@ -117,10 +117,18 @@ fn test_keyed() {
|
|||
// Make sure that keys of the wrong length lead to errors.
|
||||
for bad_length in [0, 1, blake3::KEY_LEN - 1, blake3::KEY_LEN + 1] {
|
||||
dbg!(bad_length);
|
||||
cmd!(b3sum_exe(), "--keyed", f.path())
|
||||
let output = cmd!(b3sum_exe(), "--keyed", f.path())
|
||||
.stdin_bytes(vec![0; bad_length])
|
||||
.read()
|
||||
.expect_err("a bad length key should fail");
|
||||
.stdout_capture()
|
||||
.stderr_capture()
|
||||
.unchecked()
|
||||
.run()
|
||||
.unwrap();
|
||||
assert!(!output.status.success());
|
||||
assert!(output.stdout.is_empty());
|
||||
// Make sure the error message is relevant.
|
||||
let stderr = std::str::from_utf8(&output.stderr).unwrap();
|
||||
assert!(stderr.contains("key bytes"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue