-
-
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
expr: Add tests #7356
expr: Add tests #7356
Conversation
481a155
to
11931ab
Compare
11931ab
to
892a033
Compare
GNU testsuite comparison:
|
cf5aa13
to
5aa8a62
Compare
GNU testsuite comparison:
|
5aa8a62
to
6d7f0d3
Compare
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.
PR Overview
This pull request rewrites GNU test cases for expr to better track regressions and highlights issues with our current regex dependency. Key changes include:
- Renaming the error variant from InvalidContent(String) to InvalidBracketContent.
- Updating error handling and corresponding tests in syntax_tree.rs.
- Adjusting error message attributes in expr.rs to align with the new error variant.
Reviewed Changes
File | Description |
---|---|
src/uu/expr/src/syntax_tree.rs | Renamed error variant usage and updated test assertions. |
src/uu/expr/src/expr.rs | Modified the error variant declaration and its error message. |
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/uu/expr/src/expr.rs:50
- [nitpick] The new static error message may reduce context for debugging. If dynamic error details are useful, consider reintroducing a parameterized variant to capture more specific information.
#[error("Invalid content of \{{\}}"]
GNU testsuite comparison:
|
I've rewritten all the GNU testcases of
gnu/tests/expr/expr.pl
in our testsuite, to more easily track potential regressions.Sadly, the remaining issues are all caused by our regex dependency (
rust-onig
) which has a diverging behavior from GNU. This emphasizes the need to find another regex engine, as discussed in #1145