-
Notifications
You must be signed in to change notification settings - Fork 11
Fix address range difference for line number command #260
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
base: main
Are you sure you want to change the base?
Conversation
|
GNU sed testsuite comparison: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
==========================================
- Coverage 82.15% 82.04% -0.11%
==========================================
Files 13 13
Lines 5324 5337 +13
Branches 293 295 +2
==========================================
+ Hits 4374 4379 +5
- Misses 948 955 +7
- Partials 2 3 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
GNU sed testsuite comparison: |
|
Thank you! This is a GNU extension, so the feature should not be available under |
|
Got it! I'll fix these and push again. |
|
Found out that the problem happens with the |
|
I'd suggest one commit for all commands. Try to unify the check for POSIX. |
|
GNU sed testsuite comparison: |
2 similar comments
|
GNU sed testsuite comparison: |
|
GNU sed testsuite comparison: |
81e0901 to
698f2b7
Compare
|
Squashed all my commits having removed the merge commit which was not mine. The POSIX check now happens in one place. I will update the README.md too. |
| ); | ||
| } | ||
|
|
||
| if context.is_posix_enabled() && is_gnu_extension(ch, n_addr) { |
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.
Now that I see it, maybe it would be more readable if we extracted this in a function named e.g. is_invalid_posix_cmd(...) or violates_posix(...).
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.
Consider storing in cmd_spec n_addr_posix in addition to n_addr.
|
GNU sed testsuite comparison: |
a25ecc9 to
d980254
Compare
…flag usage with GNU only extensions - Add a context parameter in get_verified_cmd_spec function and update the relative test cases - Add integration tests for address range
|
GNU sed testsuite comparison: |
|
I see you're progressing! Try running the various CI tasks locally to avoid CI failures. Please also close the PRs that you've folded into this one. |
CodSpeed Performance ReportMerging this PR will degrade performance by 3.62%Comparing Summary
Performance Changes
|
|
These two tests are failing because the supported addresses are now 2 and not 1 (like the tests assert):
Would it be "correct" to change the tests to check for 2 addresses; What I mean is, do these tests represent the standard I hope I am clear :) |
|
|
||
| impl ProcessingContext { | ||
| /// Check if POSIX extension is enabled | ||
| pub fn is_posix_enabled(&self) -> bool { |
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.
Such trivial accessors are avoided in Rust code.
|
I would expect that rather than storing / returning a number you would store
I suggest that you also store and process |
dspinellis
left a comment
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.
Please consider the initial comments I made on the code and fix the CI errors. Will then follow-up with a more complete review.
| ); | ||
| } | ||
|
|
||
| if context.is_posix_enabled() && is_gnu_extension(ch, n_addr) { |
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.
Consider storing in cmd_spec n_addr_posix in addition to n_addr.
Fixes issue 234
UPDATE
The PR now solves the problem where invalid POSIX commands with address range were being allowed when they shouldn't. These commands are:
a,i,=,l,q,r(maybe there are some more I missed).