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:
commit
618d4a4fa5
5 changed files with 31 additions and 19 deletions
|
@ -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");
|
||||
}
|
||||
|
|
2
tests/fixtures/uniq/not-utf8-sequence.txt
vendored
Normal file
2
tests/fixtures/uniq/not-utf8-sequence.txt
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
Next line contains two bytes - 0xCC and 0xCD - which are not a valid utf-8 sequence
|
||||
ÌÍ
|
2
tests/fixtures/uniq/skip-2-fields.expected
vendored
2
tests/fixtures/uniq/skip-2-fields.expected
vendored
|
@ -1,2 +1,2 @@
|
|||
aaa aa a
|
||||
aaa ⟪⟫ a
|
||||
aa a
|
||||
|
|
2
tests/fixtures/uniq/skip-fields.txt
vendored
2
tests/fixtures/uniq/skip-fields.txt
vendored
|
@ -1,4 +1,4 @@
|
|||
aaa aa a
|
||||
aaa ⟪⟫ a
|
||||
ZZZ aa a
|
||||
ZZZ aa a
|
||||
ZZZ bb a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue