mirror of
https://github.com/uutils/coreutils.git
synced 2025-07-07 21:45:01 +00:00
tests/fold: add tests for non-utf8 streams
This commit is contained in:
parent
cad7d0fe1b
commit
faa6a9bb95
6 changed files with 71 additions and 0 deletions
|
@ -554,3 +554,30 @@ fn test_obsolete_syntax() {
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_is("test1\n \ntest2\n \ntest3\n \ntest4\n \ntest5\n \ntest6\n ");
|
.stdout_is("test1\n \ntest2\n \ntest3\n \ntest4\n \ntest5\n \ntest6\n ");
|
||||||
}
|
}
|
||||||
|
#[test]
|
||||||
|
fn test_byte_break_at_non_utf8_character() {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-b")
|
||||||
|
.arg("-s")
|
||||||
|
.arg("-w")
|
||||||
|
.arg("40")
|
||||||
|
.arg("non_utf8.input")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is_fixture_bytes("non_utf8.expected");
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn test_tab_advances_at_non_utf8_character() {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-w8")
|
||||||
|
.arg("non_utf8_tab_stops.input")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is_fixture_bytes("non_utf8_tab_stops_w8.expected");
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn test_all_tab_advances_at_non_utf8_character() {
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-w16")
|
||||||
|
.arg("non_utf8_tab_stops.input")
|
||||||
|
.succeeds()
|
||||||
|
.stdout_is_fixture_bytes("non_utf8_tab_stops_w16.expected");
|
||||||
|
}
|
||||||
|
|
2
tests/fixtures/fold/non_utf8.expected
vendored
Normal file
2
tests/fixtures/fold/non_utf8.expected
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
Alle Menschen sind frei und gleich an
|
||||||
|
Würde und Rechten geboren
|
1
tests/fixtures/fold/non_utf8.input
vendored
Normal file
1
tests/fixtures/fold/non_utf8.input
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Alle Menschen sind frei und gleich an Würde und Rechten geboren
|
11
tests/fixtures/fold/non_utf8_tab_stops.input
vendored
Normal file
11
tests/fixtures/fold/non_utf8_tab_stops.input
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
タ
|
||||||
|
タチ
|
||||||
|
タチツ
|
||||||
|
タチツテ
|
||||||
|
タチツテト
|
||||||
|
タチツテトナ
|
||||||
|
タチツテトナニ
|
||||||
|
タチツテトナニヌ
|
||||||
|
タチツテトナニヌネ
|
||||||
|
タチツテトナニヌ ネ
|
||||||
|
タチツテトナニヌ ネ ノ
|
13
tests/fixtures/fold/non_utf8_tab_stops_w16.expected
vendored
Normal file
13
tests/fixtures/fold/non_utf8_tab_stops_w16.expected
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
タ
|
||||||
|
タチ
|
||||||
|
タチツ
|
||||||
|
タチツテ
|
||||||
|
タチツテト
|
||||||
|
タチツテトナ
|
||||||
|
タチツテトナニ
|
||||||
|
タチツテトナニヌ
|
||||||
|
タチツテトナニヌネ
|
||||||
|
タチツテトナニヌ
|
||||||
|
ネ
|
||||||
|
タチツテトナニヌ
|
||||||
|
ネ ノ
|
17
tests/fixtures/fold/non_utf8_tab_stops_w8.expected
vendored
Normal file
17
tests/fixtures/fold/non_utf8_tab_stops_w8.expected
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
А
|
||||||
|
АБ
|
||||||
|
АБВ
|
||||||
|
АБВГ
|
||||||
|
АБВГД
|
||||||
|
АБВГДЕ
|
||||||
|
АБВГДЕЖ
|
||||||
|
АБВГДЕЖЗ
|
||||||
|
АБВГДЕЖЗ
|
||||||
|
И
|
||||||
|
АБВГДЕЖЗ
|
||||||
|
|
||||||
|
И
|
||||||
|
АБВГДЕЖЗ
|
||||||
|
|
||||||
|
И
|
||||||
|
Й
|
Loading…
Add table
Add a link
Reference in a new issue