mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 06:02:36 +00:00
fix bad utf8 on windows
This commit is contained in:
parent
c747fea0e9
commit
ae5202944f
1 changed files with 9 additions and 1 deletions
|
@ -395,10 +395,18 @@ fn test_bad_utf_8_name() {
|
|||
let fname = bad_utf8(tmp.path(), "bad-name", ".ext");
|
||||
File::create(fname).expect("failed to create file");
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let match_str = "bad-name\u{fffd}\u{fffd}.ext\n$";
|
||||
|
||||
// when the invalid utf8 filename is read on windows,
|
||||
// some bytes are eaten up
|
||||
#[cfg(target_os = "windows")]
|
||||
let match_str = "bad-name\u{fffd}\u{fffd}xt\n$";
|
||||
|
||||
cmd()
|
||||
.arg(tmp.path())
|
||||
.assert()
|
||||
.stdout(predicate::str::is_match("bad-name\u{fffd}\u{fffd}.ext\n$").unwrap());
|
||||
.stdout(predicate::str::is_match(match_str).unwrap());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue