-
-
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
rm
: r4_gnu_test
#6621
base: main
Are you sure you want to change the base?
rm
: r4_gnu_test
#6621
Conversation
GNU testsuite comparison:
|
e345a5b
to
7864683
Compare
GNU testsuite comparison:
|
1 similar comment
GNU testsuite comparison:
|
8b80b2f
to
f69dd02
Compare
Why not make it work on Windows as well? |
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.
needs some updates
Sorry for the lack of communication, had some assignment deadlines to fulfill. I will push out updates today. |
fec794f
to
17391e3
Compare
GNU testsuite comparison:
|
17391e3
to
21cfb9c
Compare
GNU testsuite comparison:
|
3e4b765
to
8164ea8
Compare
GNU testsuite comparison:
|
@sylvestre This should be ready for a review now |
GNU testsuite comparison:
|
Is the utf-8 crate from Also, for your
Lastly, for your tests, I think you could save yourself 30ish lines and just use the conditional variable assignments for *nix/Windows ( EDIT: I realize your function is for trailing slashes, not necessarily double. You could always turn it into a more general cleaning function with the replace that I mentioned, and remove trailing, but I just misread it, my apologies. But instead of a loop at line 633, wouldn't you be able to use a built-in method for the path to get the first index and use that directly in the path slice? |
I believe my PR does remove it.
The helper functions get called only when the stat() call yields a directory. So your file example won't really trigger the code. There is no point in doing
We usually just add new tests instead of changing old tests unless it asserts wrong behavior and therefore fail, the test would be caught in the CI if people forget to change anyway.
We only care about cleaning the end of the string from slashes to print to stderr. There is no point cleaning the middle, doing a stat() call on something like Actually I was under the idea that converting windows utf-16 OsStr to rust str type might fail that's why the I was very hesitant to use strings. |
My apologies, I just saw it an my mind went to add. But yeah, I see you're actually removing it
Yeeaah, I remember that now. However, on Linux, I can also make a directory that's named
Would work just as well. But I think we need to go through the extra hassle of ensuring that's the 'entire' name of the program. There might be other ways to do that, like see if it ends with
Yeah, that's a good point. It may not cover the case of someone making a test stricter and forgetting the other one, but I think it's valid enough. And like I said, the test looks clean enough, doing a bunch of formats may make it look not so pretty.
I have no clue about that, so I'll just say that sounds good if so and leave it to you and Sylvestre. |
Good catch, i will push a fix for that. |
It seems like there is some niche behavior with GNU which does seem like a bug.
It seems like gnu converts the path into Linux allows both files and directories to be named
@sylvestre Need some advice on how to handle this . Do we just do the same and read the path as overlapping instances of |
What setup are you on? I just made files and directories with a bunch of '.'s, and couldn't replicate it. For GNU, I mean. I'm on Mint 20.1, x86 |
Have you checked the hidden files to see if they exist ? Doing |
Yeah, I just ran it, making |
Well, i also installed coreutils 9.4 to check, it gives the same error. I will chalk it up to something on my machine which i can't figure out. A person on the discord has also confirmed few days ago they weren't facing any issues. So its very likely something on my machine which i cannot figure out. |
4aa778a
to
117c174
Compare
GNU testsuite comparison:
|
Hey, is this still something you're working on? |
Ideally this should just need a review but the conversation here became too long to extract relevant context. You can start updating your pr. Feel free to pull things from here. |
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.
Thank you for tackling these issues! Can you fix the formatting issues and the crash? Bonus points if you also decide to handle non-utf8-filenames correctly, but I could understand if you decide that's out of scope.
Alright, but I may not be able to get to it for a day or two. But I do like how you clean trailing slashes, and I think your tests are more clean. I think if you fix the above things Ben mentioned, and make it agnostic to *nix/Windows, it'll be exactly what I was thinking |
Ok, i will work on it then. |
95fc670
to
b3d348c
Compare
GNU testsuite comparison:
|
1 similar comment
GNU testsuite comparison:
|
23c0da6
to
fd9df17
Compare
GNU testsuite comparison:
|
fd9df17
to
1ba9c88
Compare
GNU testsuite comparison:
|
1ba9c88
to
ef42649
Compare
GNU testsuite comparison:
|
ef42649
to
56b6a42
Compare
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 PR now touches --no-preserve-root
, and I'm not yet convinced that the code is correct. Are you sure you want to handle this in the same PR?
56b6a42
to
5a3d9de
Compare
GNU testsuite comparison:
|
Added regex detection to various combination of ".." and "." followed by slashes .