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

@ -13,7 +13,7 @@ fn test_invalid_arg() {
fn test_path_with_trailing_slashes() {
new_ucmd!()
.arg("/root/alpha/beta/gamma/delta/epsilon/omega//")
.run()
.succeeds()
.stdout_is("/root/alpha/beta/gamma/delta/epsilon\n");
}
@ -21,7 +21,7 @@ fn test_path_with_trailing_slashes() {
fn test_path_without_trailing_slashes() {
new_ucmd!()
.arg("/root/alpha/beta/gamma/delta/epsilon/omega")
.run()
.succeeds()
.stdout_is("/root/alpha/beta/gamma/delta/epsilon\n");
}
@ -52,15 +52,15 @@ fn test_repeated_zero() {
#[test]
fn test_root() {
new_ucmd!().arg("/").run().stdout_is("/\n");
new_ucmd!().arg("/").succeeds().stdout_is("/\n");
}
#[test]
fn test_pwd() {
new_ucmd!().arg(".").run().stdout_is(".\n");
new_ucmd!().arg(".").succeeds().stdout_is(".\n");
}
#[test]
fn test_empty() {
new_ucmd!().arg("").run().stdout_is(".\n");
new_ucmd!().arg("").succeeds().stdout_is(".\n");
}