-
-
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
chmod: fix GNU test 'chmod/usage' #4442
Conversation
Nice! Could you be a bit more descriptive in the PR title and description? I.e. describe the actual change you're making or the bug you're fixing? |
GNU testsuite comparison:
|
1816490
to
0ae26a7
Compare
Beside the not allowed re-occurence of options, I found another problem: [1] https://www.gnu.org/software/coreutils/manual/html_node/Symbolic-Modes.html |
GNU testsuite comparison:
|
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.
This utility seems to be a bit of a mess 😅 (which is by no means your fault), I'm glad you picked this to improve!
There's maybe an alternative approach here that's worth exploring where files can take hyphen values? Though I'm not sure we can get that to be just as compatible.
GNU testsuite comparison:
|
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 think it's mostly good now! Just needs a bit more comments to explain why all this is necessary.
GNU testsuite comparison:
|
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.
Excellent! Great work!
fixes chmod/usage.
The description of the test says:
The tests are (basically) combinations (and re-occurrences) of options, like (
f
considered as valid file):chmod -- -w -- f
,chmod -- -- -- f
,chmod -w -w -- f
I then tried (testwise):
which seems to me like the options (like
-w
) are splitted from the files.So my idea was to split the options from the files, keep order, and then "uniq" them before giving them to clap.
However, target is to find the not-working test cases, port them to the Rust unit tests, fix them, check for regression :)