-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use the new function fails_with_code #7371
Conversation
d68c9ac
to
01b51b9
Compare
877b555
to
b2697dd
Compare
GNU testsuite comparison:
|
b2697dd
to
2bf6195
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scripts look like they behaved weirdly on some files
tests/by-util/test_chmod.rs
Outdated
.no_stderr() | ||
.code_is(1); | ||
.no_stderr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here fails()
was not changed to fail_with_code()
.
tests/by-util/test_chroot.rs
Outdated
@@ -160,7 +159,7 @@ fn test_preference_of_userspec() { | |||
.arg("--groups") | |||
.arg("ABC,DEF") | |||
.arg(format!("--userspec={username}:{group_name}")) | |||
.fails(); | |||
.fails_with_code(125); | |||
|
|||
result.code_is(125); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should remove this line ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, missed this pattern!
tests/by-util/test_cksum.rs
Outdated
.fails() | ||
.no_stdout() | ||
.stderr_contains("cksum: the --raw option is not supported with multiple files") | ||
.code_is(1); | ||
.stderr_contains("cksum: the --raw option is not supported with multiple files"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But here
GNU testsuite comparison:
|
Done with ``` $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs $ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs ... ```
2bf6195
to
18cb7dc
Compare
done with