Skip to content

feat: add R command#432

Open
MukundaKatta wants to merge 1 commit into
uutils:mainfrom
MukundaKatta:codex/add-r-line-command
Open

feat: add R command#432
MukundaKatta wants to merge 1 commit into
uutils:mainfrom
MukundaKatta:codex/add-r-line-command

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

  • add GNU sed's R command outside POSIX mode
  • share one lazy reader per filename so repeated R commands consume one line at a time
  • silently ignore missing files and EOF, matching GNU behavior
  • cover repeated reads, missing/EOF behavior, and POSIX rejection

Fixes #394.

Tests

  • cargo fmt --check
  • cargo test read_one_line
  • manual reproduction: cargo run --quiet -- -e "1R<file>" -e "2R<file>" <input>
  • cargo test test_sed
  • cargo test

@github-actions
Copy link
Copy Markdown

GNU sed testsuite comparison:

Test results comparison:
  Current:   TOTAL: 65 / PASSED: 9 / FAILED: 46 / SKIPPED: 10
  Reference: TOTAL: 65 / PASSED: 8 / FAILED: 47 / SKIPPED: 10

Changes from main branch:
  TOTAL: +0
  PASSED: +1
  FAILED: -1

Test improvements (1):
  + cmd-R

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 2.56410% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.66%. Comparing base (f083fa0) to head (23a0a1a).

Files with missing lines Patch % Lines
src/sed/compiler.rs 0.00% 19 Missing ⚠️
src/sed/processor.rs 0.00% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
- Coverage   82.20%   81.66%   -0.55%     
==========================================
  Files          13       13              
  Lines        5542     5579      +37     
  Branches      310      315       +5     
==========================================
  Hits         4556     4556              
- Misses        983     1020      +37     
  Partials        3        3              
Flag Coverage Δ
macos_latest 82.33% <2.56%> (-0.57%) ⬇️
ubuntu_latest 82.44% <2.56%> (-0.56%) ⬇️
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 Sentry.
📢 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-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 15, 2026

Merging this PR will improve performance by 2.75%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 10 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
genome_subst 215.5 ms 209.7 ms +2.75%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing MukundaKatta:codex/add-r-line-command (23a0a1a) with main (f083fa0)

Open in CodSpeed

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.

Add R command (read one line from file)

1 participant