1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

uniq: Fix panic on invalid utf-8 input

This commit is contained in:
Chirag Jadwani 2021-03-15 14:08:14 +05:30
parent 4574b2b58d
commit ce4342d12e
3 changed files with 18 additions and 3 deletions

View file

@ -138,3 +138,12 @@ fn test_stdin_zero_terminated() {
.run()
.stdout_is_fixture("sorted-zero-terminated.expected");
}
#[test]
fn test_invalid_utf8() {
new_ucmd!()
.arg("not-utf8-sequence.txt")
.run()
.failure()
.stderr_only("uniq: error: invalid utf-8 sequence of 1 bytes from index 0");
}