-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
unexpand: should allow multiple files #5852 and unexpand: show error message if a directory is specified #5845 #5864
Conversation
…message if a directory is specified #5845
GNU testsuite comparison:
|
do i have to write the test cases also for the above fix ? |
Yes, please :) |
how to add content to the files
|
You can use |
why this test is failing Style/spelling (ubuntu-latest, feat_os_unix) |
It fails because "contenta" isn't a valid English word. I think you are missing a
|
the test is failing if \n is added the stdout is printing "contenta b" this only |
Yes, you also have to adapt your implementation ;-) Best to look at what GNU
Here you can see, that GNU Hope this helps. |
here the output is same to GNU i mean in the above it is printing on new line in the test cases i don't why it is not adding \n for a new line |
You are right, the implementation works fine :) I don't know yet why there is no |
what should be next step this test case will not fail after that |
Ok, I figured out I was wrong and your test is correct. Sorry about that. To make the Style/Spelling test pass, you can add
below the license info in |
tests/by-util/test_unexpand.rs
Outdated
let (at, mut ucmd) = at_and_ucmd!(); | ||
|
||
ucmd.arg("asdf.txt") |
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.
The at
causes an "unused variable"-warning. Instead of at_and_ucmd!()
you can simply use new_cmd!()
in this case:
let (at, mut ucmd) = at_and_ucmd!(); | |
ucmd.arg("asdf.txt") | |
new_cmd!() | |
.arg("asdf.txt") |
src/uu/unexpand/src/unexpand.rs
Outdated
if filename.is_dir() { | ||
Err(Box::new(USimpleError { | ||
code: 1, | ||
message: format!("unexpand: {}: Is a directory", filename.display()), |
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.
USimpleError
automatically adds the utils name so you don't have to add it manually:
message: format!("unexpand: {}: Is a directory", filename.display()), | |
message: format!("{}: Is a directory", filename.display()), |
Thanks you for the suggestion |
is my PR ready for merge ? |
And merged, thanks for your PR :) |
Thank you for your cooperation |
Great to hear, you are welcome :) |
fix in this PR