Skip to content

Commit

Permalink
fix chown tests: test stdout and not stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
djedi23 authored and cakebaker committed May 22, 2023
1 parent 75baf2a commit 349df47
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions tests/by-util/test_chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -764,9 +764,7 @@ fn test_chown_no_change_to_user_from_user() {
.arg("43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}\n"
));
.stdout_only(format!("ownership of '{file}' retained as {user_name}\n"));
}

#[test]
Expand All @@ -790,9 +788,7 @@ fn test_chown_no_change_to_user_from_group() {
.arg("43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}\n"
));
.stdout_only(format!("ownership of '{file}' retained as {user_name}\n"));
}

#[test]
Expand All @@ -816,9 +812,7 @@ fn test_chown_no_change_to_user_from_user_group() {
.arg("43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}\n"
));
.stdout_only(format!("ownership of '{file}' retained as {user_name}\n"));
}

#[test]
Expand Down Expand Up @@ -849,8 +843,8 @@ fn test_chown_no_change_to_group_from_user() {
.arg(":43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

Expand Down Expand Up @@ -881,8 +875,8 @@ fn test_chown_no_change_to_group_from_group() {
.arg(":43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

Expand Down Expand Up @@ -913,8 +907,8 @@ fn test_chown_no_change_to_group_from_user_group() {
.arg(":43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

Expand Down Expand Up @@ -946,8 +940,8 @@ fn test_chown_no_change_to_user_group_from_user() {
.arg("43:43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

Expand Down Expand Up @@ -978,8 +972,8 @@ fn test_chown_no_change_to_user_group_from_group() {
.arg("43:43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

Expand Down Expand Up @@ -1010,7 +1004,7 @@ fn test_chown_no_change_to_user_group_from_user_group() {
.arg("43:43")
.arg(file)
.succeeds()
.stderr_only(format!(
"chown: ownership of '{file}' retained as {user_name}:{group_name}\n"
.stdout_only(format!(
"ownership of '{file}' retained as {user_name}:{group_name}\n"
));
}

0 comments on commit 349df47

Please sign in to comment.