-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
cp: set status code when encountering circular symbolic links #9757
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
base: main
Are you sure you want to change the base?
Conversation
…n copying directory
… circular symbolic links during directory copy
tests/by-util/test_cp.rs
Outdated
| ucmd.arg(source_dir) | ||
| .arg(target_dir) | ||
| .arg("-rL") | ||
| .fails_with_code(1); |
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.
please also verify the output
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.
I updated the test to check for the output. I did not check for an exact match of the stderr since I think they might differ slightly depending on the OS and "Too many levels of symbolic links" should be a good enough indicator that the command is outputting what we expect I think.
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.
I don't want to make the test to complex and test for the full output for the different OSes so I updated the test to simply check for the string from walkdir.
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.
I updated the tests again to include windows-specific syntax for the error message
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Fixes #9710
Change from using the
show_error!macro to theshow!macro which correctly sets the status code.Added a new test to validate this behavior.