Skip to content

stdbuf: remove crash macro#5549

Merged
cakebaker merged 5 commits intouutils:mainfrom
cswn:stdbuf-remove-crash-macro
Nov 20, 2023
Merged

stdbuf: remove crash macro#5549
cakebaker merged 5 commits intouutils:mainfrom
cswn:stdbuf-remove-crash-macro

Conversation

@cswn
Copy link
Copy Markdown
Contributor

@cswn cswn commented Nov 16, 2023

This is related to issue: #5487
Removes the crash! macro from stdbuf.

@cswn cswn changed the title Stdbuf remove crash macro stdbuf: remove crash macro Nov 16, 2023
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/inotify-dir-recreate. tests/tail/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?

@cakebaker
Copy link
Copy Markdown
Contributor

Did you see that test_stdbuf_invalid_mode_fails now fails?

@cswn
Copy link
Copy Markdown
Contributor Author

cswn commented Nov 17, 2023

No, I didn't, will take a look now

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/tail/symlink is no longer failing!
GNU test failed: tests/tail/inotify-dir-recreate. tests/tail/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

Copy link
Copy Markdown
Collaborator

@tertsdiepraam tertsdiepraam left a comment

Choose a reason for hiding this comment

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

Nice! Just one suggestion

x => parse_size_u64(x).map_or_else(
|e| crash!(125, "invalid mode {}", e),
|e| {
set_exit_code(125);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this lines should not be necessary. The exit code should be added to the error here:

let options = ProgramOptions::try_from(&matches).map_err(|e| UUsageError::new(125, e.0))?;

It'd be great if you could also verify that this is actually the case by writing a test for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, you're right, I've taken that line out. However, the test already asserts that the error code is 125: https://github.com/cswn/coreutils/blob/26df9445fb70152abfd523c0bdb75def6c7d5475/tests/by-util/test_stdbuf.rs#L67C9-L67C9

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool!

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/truncate. tests/tail/truncate is passing on 'main'. Maybe you have to rebase?

@cakebaker cakebaker merged commit 58087df into uutils:main Nov 20, 2023
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks!

@cswn cswn deleted the stdbuf-remove-crash-macro branch November 20, 2023 10:15
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.

3 participants