-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
test: replace panic in favor of ParseError #4558
Conversation
GNU testsuite comparison:
|
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.
Nice! I think we can even take this a bit further and avoid using strings as errors altogether if ParseError
implements UError
.
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.
It's looking good! Just a few small suggestions.
@@ -128,23 +130,18 @@ pub fn uumain(mut args: impl uucore::Args) -> UResult<()> { | |||
} | |||
} | |||
|
|||
let result = parse(args).and_then(|mut stack| eval(&mut stack)); | |||
let result = parse(args).map(|mut stack| eval(&mut stack))??; |
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.
Is this equivalent to eval(parse(args)?)?
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.
@tertsdiepraam Yes it is, you prefer eval(parse(args)?)?
syntax ?
393eb2b
to
11fd56c
Compare
GNU testsuite comparison:
|
Look like the failling tests are related to #4634 |
thanks :) |
Closes #4556
Closes #4555