-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Regression test #210 fails on macOS High Sierra #559
Comments
This is the test in question: // See: https://github.com/BurntSushi/ripgrep/issues/210
#[cfg(unix)]
#[test]
fn regression_210() {
use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;
let badutf8 = OsStr::from_bytes(&b"foo\xffbar"[..]);
let wd = WorkDir::new("regression_210");
let mut cmd = wd.command();
wd.create(badutf8, "test");
cmd.arg("-H").arg("test").arg(badutf8);
let out = wd.output(&mut cmd);
assert_eq!(out.stdout, b"foo\xffbar:test\n".to_vec());
} This test is specifically testing a case where there is an invalid UTF-8 byte in a file path (which is a valid thing to do) and that ripgrep still happily searches said file. The APFS docs link says this:
Which means this test probably doesn't make sense on a file system that specifically rejects invalid UTF-8. This also means that I don't think there is any bug in I think the proper work-around here is to modify the test to pass if it is unable to create a file with an invalid UTF-8 name. |
Or you can add a #cfg[] param to exclude macosx so the test isn't run at all on that platform Something like #[cfg(all(unix,not(target_os="macos")))] |
APFS does not support creating filenames with invalid UTF-8 byte codes, thus this test doesn't make sense. Skip it on file systems where this shouldn't be possible. Fixes BurntSushi#559
APFS does not support creating filenames with invalid UTF-8 byte codes, thus this test doesn't make sense. Skip it on file systems where this shouldn't be possible. Fixes #559
I'm not positive as to why, but I have a feeling it may be related to normalization-insensitivity in APFS. If I understand the APFS docs and the test case correctly, this may actually be an issue in
std::ffi
, and if that's the case then I'll report this up the chain.The text was updated successfully, but these errors were encountered: