Skip to content

sed: discard text queued by a, r and R on Q, as GNU sed does - #594

Merged
sylvestre merged 1 commit into
uutils:mainfrom
DePasqualeOrg:fix-q-discards-appends
Oct 5, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
DePasqualeOrg:fix-q-discards-appends

Conversation

@DePasqualeOrg

@DePasqualeOrg DePasqualeOrg commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Q quits without printing the pattern space, and GNU sed also discards any text that a, r or R queued in the same cycle. uutils sed writes that text: printf 'x\n' | sed -e 'a A' -e Q prints A, while GNU sed prints nothing. This PR clears the queue on Q. q still writes queued text, as in GNU sed.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.82%. Comparing base (3676eac) to head (840add2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #594   +/-   ##
=======================================
  Coverage   94.82%   94.82%           
=======================================
  Files          14       14           
  Lines        7212     7213    +1     
  Branches      428      428           
=======================================
+ Hits         6839     6840    +1     
  Misses        372      372           
  Partials        1        1           
Flag Coverage Δ
macos_latest 96.37% <100.00%> (+<0.01%) ⬆️
ubuntu_latest 96.31% <100.00%> (+<0.01%) ⬆️
windows_latest 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 7 improved benchmarks
❌ 1 regressed benchmark
✅ 3 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ access_log_translit 999.6 ms 1,024.7 ms -2.45%
⚡ no_op_short 2.4 s 2.2 s +10.64%
⚡ access_log_no_op 1.7 s 1.6 s +7.44%
⚡ access_log_append 1.5 s 1.4 s +2.99%
⚡ access_log_no_del 1.1 s 1.1 s +2.38%
⚡ access_log_no_subst 1.1 s 1.1 s +2.38%
⚡ remove_cr 518.6 ms 506.5 ms +2.38%
⚡ access_log_all_del 1.1 s 1.1 s +2.31%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing DePasqualeOrg:fix-q-discards-appends (f2ac3ee) with main (479c4be)

Open in CodSpeed

@DePasqualeOrg
DePasqualeOrg force-pushed the fix-q-discards-appends branch from 8374812 to 840add2 Compare October 4, 2026 10:19
@DePasqualeOrg
DePasqualeOrg marked this pull request as ready for review October 4, 2026 10:40
Comment thread tests/by-util/test_sed.rs
}

/// `Q` discards text queued by `a`, `r` and `R`, as GNU sed does.
#[test]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the test_ prefix like the other tests

@DePasqualeOrg
DePasqualeOrg force-pushed the fix-q-discards-appends branch from 840add2 to f2ac3ee Compare October 5, 2026 08:20
@sylvestre
sylvestre merged commit d43d4de into uutils:main Oct 5, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants