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
assets::tests::syntax_detection_invalid_utf8 failed with 0.15.1 #983
Comments
The test failure also occurs when running |
I suspect this is a test that simply always fails on macOS. It appears to be attempting to create a filename with invalid utf8, but macOS doesn't allow this. This test will need to be disabled for macOS. |
The following diff fixes diff --git a/src/assets.rs b/src/assets.rs
index 4f8556f..222abc2 100644
--- a/src/assets.rs
+++ b/src/assets.rs
@@ -336,7 +336,7 @@ mod tests {
assert_eq!(test.syntax_for_file("Makefile"), "Makefile");
}
- #[cfg(unix)]
+ #[cfg(all(unix,not(target_os = "macos")))]
#[test]
fn syntax_detection_invalid_utf8() {
use std::os::unix::ffi::OsStrExt; However it does introduce a warning
I don't know if it's better to cfg-out that function on macos too, or just mark it with |
I've included the above patch in the Nix PR for 0.15.1. |
Disabling the tests on MacOS is a working solution, but I felt like it still left some room for error (e.g. Linux with ZFS |
Oh right. I ran into this with
So how about just letting the test succeed in case the file could not be created? I think that would be a reasonable solution which would work on all operating systems.
Thanks. Let's discuss these changes in the PR. |
It looks like HFS+ allows invalid UTF-8 by transforming the filename. The name |
Unify syntax detection for all variants of InputKind, fix #983
Confirmed fixed, thank you. |
I just tried compiling bat 0.15.1 via Nix on macOS and it failed during the tests phase:
Also of note, the color escapes used by the test runner all stuck a visible
(B
after each colored string. Which is to say, each "ok" was "ok(B" and the "FAILED" was "FAILED(B". Colors printed by rustc itself were fine. I don't know if this is meaningful or just weird though.The text was updated successfully, but these errors were encountered: