1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

tests/fold: add tests for non-utf8 streams

This commit is contained in:
Phineas Jensen 2025-06-21 21:57:40 -06:00
parent cad7d0fe1b
commit faa6a9bb95
6 changed files with 71 additions and 0 deletions

View file

@ -554,3 +554,30 @@ fn test_obsolete_syntax() {
.succeeds()
.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");
}