fmt: fix panic on width argument#5159
Merged
Conversation
cakebaker
reviewed
Aug 14, 2023
Contributor
cakebaker
left a comment
There was a problem hiding this comment.
Great to see some fmt tests :)
cakebaker
reviewed
Aug 14, 2023
Comment on lines
+47
to
+55
| #[test] | ||
| fn test_fmt_goal() { | ||
| for param in ["-g", "--goal"] { | ||
| new_ucmd!() | ||
| .args(&["one-word-per-line.txt", param, "7"]) | ||
| .succeeds() | ||
| .stdout_is("this is\na file\nwith one\nword per\nline\n"); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
The expected output of this test is different than the output of GNU fmt. When I run GNU fmt with fmt tests/fixtures/fmt/one-word-per-line.txt -g7 I get the following output:
this is a
file with one
word per line
So I would either mark this test with #[ignore] and/or add a comment with a todo.
Author
There was a problem hiding this comment.
Thank you for reviewing. I fixed test and ignore it.
- fix test to get same result as GNU fmt
Contributor
|
Thanks for your PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #5150
Changed the confirmation method from get_flag to contains_id. And added several tests.