-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ln: add error handling for hard link creation on directories #9342
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
Conversation
|
Lgtm (waiting for the ci now) |
tests/by-util/test_ln.rs
Outdated
| let result = scene.ucmd().args(&["dir", "dir_link"]).fails(); | ||
|
|
||
| assert!( | ||
| result | ||
| .stderr_str() | ||
| .contains("hard link not allowed for directory") | ||
| ); |
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.
A detail: you can simplify the code a bit by using stderr_contains:
| let result = scene.ucmd().args(&["dir", "dir_link"]).fails(); | |
| assert!( | |
| result | |
| .stderr_str() | |
| .contains("hard link not allowed for directory") | |
| ); | |
| scene | |
| .ucmd() | |
| .args(&["dir", "dir_link"]) | |
| .fails() | |
| .stderr_contains("hard link not allowed for directory"); |
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.
totally missed that, adding it now
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU tests seem to not pass still, even though I am mimicking the behaviour of my builtin ln. |
|
GNU testsuite comparison: |
|
@FidelSch we replace the error message used in the GNU test in |
|
GNU testsuite comparison: |
|
Thanks for your PR! |
Adresses #9333