1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

tests/util: Introduce CmdResult::stdout_str_apply ... to preprocess stdout, stderr before asserting

This commit is contained in:
Joining7943 2022-11-30 07:35:52 +01:00
parent 3977ef608e
commit 37e06edadc
3 changed files with 83 additions and 13 deletions

View file

@ -28,8 +28,11 @@ fn test_uname_processor() {
#[test]
fn test_uname_hardware_platform() {
let result = new_ucmd!().arg("-i").succeeds();
assert_eq!(result.stdout_str().trim_end(), "unknown");
new_ucmd!()
.arg("-i")
.succeeds()
.stdout_str_apply(str::trim_end)
.stdout_only("unknown");
}
#[test]