Repository navigation
sed: print the c text when a numeric, relative or step range ends - #617
Open
jayhemnani9910 wants to merge 1 commit into
Open
jayhemnani9910 wants to merge 1 commit into
jayhemnani9910 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #617 +/- ##
==========================================
- Coverage 94.93% 94.91% -0.03%
==========================================
Files 14 14
Lines 7292 7302 +10
Branches 434 436 +2
==========================================
+ Hits 6923 6931 +8
- Misses 368 370 +2
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
With a range whose end is a line number,
+Nor~N,cdeletes the lines but never prints its text. GNU sed 4.9 vs main:The same for
2,+2cand2,~4c;/re/,/re/cworks. Related cases in the same code:appliesonly setlast_addresswhen a regex or$ended the range, and never cleared it, soceither missed the end or printed on every later line;calso printed at the last input line of an unfinished range and skipped negated ranges. Nowlast_addressis cleared for each command and set when a line,+Nor~Nend is reached; the range closes on that line, so the next line can start it again (the/a/,3dcase).cprints at the end of a range, and on every line of a negated one.New tests
test_change_command_prints_text_at_range_endandtest_range_with_line_end_restarts_on_next_linefail on main.cargo test: 748 passed (746 on main plus the two), clippy and fmt clean. 26 scripts withc,d,p,n,Nand blocks over numeric, relative, step and regex ranges give the same output as GNU sed 4.9 on three inputs.