We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 957748c commit 47a9544Copy full SHA for 47a9544
1 file changed
crates/cli/src/file_utils.rs
@@ -913,6 +913,23 @@ mod tests {
913
);
914
}
915
916
+ #[cfg(target_os = "linux")]
917
+ #[test]
918
+ fn get_files_non_utf8_path() {
919
+ let tmp = TestDir::new();
920
+
921
+ let valid_path = tmp.base_path().join("valid.js");
922
+ fs::File::create(&valid_path).unwrap();
923
+ // (0xFF isn't a valid UTF-8 byte)
924
+ let invalid_path = tmp
925
+ .base_path()
926
+ .join(<std::ffi::OsStr as std::os::unix::ffi::OsStrExt>::from_bytes(b"\xFF.js"));
927
+ fs::File::create(&invalid_path).unwrap();
928
929
+ let files = get_files(tmp.base_path(), vec![], &PathConfig::default()).unwrap();
930
+ assert_eq!(files, vec![valid_path]);
931
+ }
932
933
#[test]
934
fn test_get_language_for_file() {
935
// extension Java
0 commit comments