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

Merge pull request #4293 from Joining7943/tests-util-refactor-ucommand-add-run-in-shell

`tests/util`: Small Refactor/Fixes of `UCommand` and add method to run a `UCommand` in a shell platform independently
This commit is contained in:
Terts Diepraam 2023-02-21 22:41:20 +01:00 committed by GitHub
commit 6bd42fde6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 406 additions and 248 deletions

View file

@ -48,15 +48,12 @@ fn run_single_test(test: &TestCase, at: &AtPath, mut ucmd: UCommand) {
let r = ucmd.run();
if !r.succeeded() {
println!("{}", r.stderr_str());
panic!("{:?}: failed", ucmd.raw);
panic!("{ucmd}: failed");
}
let perms = at.metadata(TEST_FILE).permissions().mode();
if perms != test.after {
panic!(
"{:?}: expected: {:o} got: {:o}",
ucmd.raw, test.after, perms
);
panic!("{}: expected: {:o} got: {:o}", ucmd, test.after, perms);
}
}