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

Merge pull request #1825 from cbjadwani/uniq-utf8-issues

uniq: utf-8 issues
This commit is contained in:
Sylvestre Ledru 2021-03-16 21:18:31 +01:00 committed by GitHub
commit 618d4a4fa5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 19 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");
}

View file

@ -0,0 +1,2 @@
Next line contains two bytes - 0xCC and 0xCD - which are not a valid utf-8 sequence
ÌÍ

View file

@ -1,2 +1,2 @@
aaa aa a
aaa ⟪⟫ a
aa a

View file

@ -1,4 +1,4 @@
aaa aa a
aaa ⟪⟫ a
ZZZ aa a
ZZZ aa a
ZZZ bb a