Skip to content
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

Handle the rewrite of "-" to "/dev/stdin" in main to leave the filenames unchanged (fixes #46) #47

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

oSoMoN
Copy link
Collaborator

@oSoMoN oSoMoN commented Apr 3, 2024

No description provided.

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 76.86%. Comparing base (9507ca2) to head (00a63af).

❗ Current head 00a63af differs from pull request most recent head e1c319f. Consider uploading reports for the commit e1c319f to get more accurate results

Files Patch % Lines
tests/integration.rs 80.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
- Coverage   76.98%   76.86%   -0.12%     
==========================================
  Files           9        9              
  Lines        2572     2576       +4     
  Branches      659      660       +1     
==========================================
  Hits         1980     1980              
- Misses        462      466       +4     
  Partials      130      130              
Flag Coverage Δ
macos_latest 77.04% <92.30%> (+0.69%) ⬆️
ubuntu_latest 76.90% <92.30%> (-0.12%) ⬇️

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.

@sylvestre sylvestre force-pushed the handle-stdin-filename branch from ac1d824 to 8a4e3d1 Compare April 4, 2024 06:49
@oSoMoN oSoMoN marked this pull request as draft April 4, 2024 18:11
@oSoMoN
Copy link
Collaborator Author

oSoMoN commented Apr 4, 2024

I marked this PR as draft because reading "/dev/stdin" doesn't work on Windows, as was to be expected. Let's fix this while working on this code.

@oSoMoN oSoMoN marked this pull request as ready for review April 4, 2024 20:22
@oSoMoN oSoMoN force-pushed the handle-stdin-filename branch from 00a63af to 84ad116 Compare April 8, 2024 18:21
Comment on lines -479 to +480
from: os("/dev/stdin"),
to: os("/dev/stdin"),
from: os("-"),
to: os("-"),

Choose a reason for hiding this comment

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

Please keep at least one test that uses /dev/stdin. I think the right way to mark a test as "unix-only" is #[cfg(unix)] right before fn.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Those tests do not actually exercise reading from stdin, only the parsing of command-line parameters. I don't see much added value to verifying that /dev/stdin doesn't get rewritten.

However I can add an integration test that exercises reading from /dev/stdin.

Choose a reason for hiding this comment

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

Ah, sorry, I got that wrong. And thank you, that's exactly what I was hoping for! :)

@sylvestre sylvestre merged commit be66ff3 into uutils:main Apr 9, 2024
21 of 23 checks passed
@oSoMoN oSoMoN deleted the handle-stdin-filename branch April 30, 2024 22:04
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.

3 participants