Fix bug for file with invalid-utf8 filenames

This commit is contained in:
sharkdp committed 2020-04-21 14:09:18 +02:00
1 parent 47abb192bc
commit 82e20bfe14
3 files changed
+19 -7

No files matched your search

+12
View File
@@ -628,6 +628,18 @@ fn filename_multiple_err() {
.failure();
}
#[cfg(target_os = "linux")]
#[test]
fn file_with_invalid_utf8_filename() {
use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;
bat()
.arg(OsStr::from_bytes(b"test-invalid-utf8-\xC3(.rs"))
.assert()
.success();
}
#[test]
fn do_not_panic_regression_tests() {
for filename in &[