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

tests: replace run() with succeeds() or fails()

This commit is contained in:
Daniel Hofstetter 2025-03-09 16:53:56 +01:00
parent 3844a74c38
commit df4dfea852
39 changed files with 434 additions and 498 deletions

View file

@ -102,13 +102,13 @@ fn test_chown_only_owner() {
at.touch(file1);
// since only superuser can change owner, we have to change from ourself to ourself
let result = scene
scene
.ucmd()
.arg(user_name)
.arg("--verbose")
.arg(file1)
.run();
result.stderr_contains("retained as");
.succeeds()
.stderr_contains("retained as");
// try to change to another existing user, e.g. 'root'
scene
@ -672,16 +672,16 @@ fn test_chown_recursive() {
at.touch(at.plus_as_string("a/b/c/c"));
at.touch(at.plus_as_string("z/y"));
let result = scene
scene
.ucmd()
.arg("-R")
.arg("--verbose")
.arg(user_name)
.arg("a")
.arg("z")
.run();
result.stderr_contains("ownership of 'a/a' retained as");
result.stderr_contains("ownership of 'z/y' retained as");
.succeeds()
.stderr_contains("ownership of 'a/a' retained as")
.stderr_contains("ownership of 'z/y' retained as");
}
#[test]