Skip to content
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

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

sylvestre
Copy link
Contributor

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

@sylvestre sylvestre force-pushed the use-new-function branch 2 times, most recently from d68c9ac to 01b51b9 Compare March 1, 2025 15:16
@sylvestre sylvestre changed the title use the new version fails_with_code use the new function fails_with_code Mar 1, 2025
@sylvestre sylvestre force-pushed the use-new-function branch 2 times, most recently from 877b555 to b2697dd Compare March 1, 2025 15:25
@sylvestre sylvestre requested a review from RenjiSann March 1, 2025 15:43
Copy link

github-actions bot commented Mar 1, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Copy link
Collaborator

@RenjiSann RenjiSann left a 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

Comment on lines 446 to 445
.no_stderr()
.code_is(1);
.no_stderr();
Copy link
Collaborator

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().

@@ -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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remove this line ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, missed this pattern!

Comment on lines 438 to 440
.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");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But here

Copy link

github-actions bot commented Mar 1, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

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
...
```
@sylvestre sylvestre requested a review from RenjiSann March 1, 2025 18:09
@sylvestre sylvestre merged commit 0936cee into uutils:main Mar 4, 2025
65 checks passed
@sylvestre sylvestre deleted the use-new-function branch March 4, 2025 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants