diff --git a/tests/by-util/test_ptx.rs b/tests/by-util/test_ptx.rs index 426792e05..7fd40db76 100644 --- a/tests/by-util/test_ptx.rs +++ b/tests/by-util/test_ptx.rs @@ -11,6 +11,25 @@ fn test_invalid_arg() { new_ucmd!().arg("--definitely-invalid").fails_with_code(1); } +#[test] +fn test_tex_format_no_truncation_markers() { + let input = "Hello world Rust is a fun language"; + new_ucmd!() + .args(&["-G", "-w", "30", "--format=tex"]) + .pipe_in(input) + .succeeds() + .stdout_only_fixture("test_tex_format_no_truncation_markers.expected"); +} +#[test] +fn gnu_ext_disabled_chunk_no_over_reading() { + let input = "Hello World Rust is a fun language"; + new_ucmd!() + .args(&["-G", "-w", "30"]) + .pipe_in(input) + .succeeds() + .stdout_only_fixture("gnu_ext_disabled_chunk_no_over_reading.expected"); +} + #[test] fn test_truncation_no_extra_space_in_after() { new_ucmd!() diff --git a/tests/fixtures/ptx/gnu_ext_disabled_chunk_no_over_reading.expected b/tests/fixtures/ptx/gnu_ext_disabled_chunk_no_over_reading.expected new file mode 100644 index 000000000..8b84c3038 --- /dev/null +++ b/tests/fixtures/ptx/gnu_ext_disabled_chunk_no_over_reading.expected @@ -0,0 +1,7 @@ +.xx "Rust is/" "" "Hello World" "" +.xx "" "Hello World" "Rust is a/" "" +.xx "is/" "Hello" "World Rust" "" +.xx "" "/Rust is" "a fun/" "" +.xx "" "/Rust is a" "fun language" "" +.xx "" "/World Rust" "is a fun/" "" +.xx "" "/is a fun" "language" "" diff --git a/tests/fixtures/ptx/test_tex_format_no_truncation_markers.expected b/tests/fixtures/ptx/test_tex_format_no_truncation_markers.expected new file mode 100644 index 000000000..14dc9d3db --- /dev/null +++ b/tests/fixtures/ptx/test_tex_format_no_truncation_markers.expected @@ -0,0 +1,7 @@ +\xx {Rust is}{}{Hello}{ world}{} +\xx {}{Hello world}{Rust}{ is a}{} +\xx {}{Rust is}{a}{ fun}{} +\xx {}{Rust is a}{fun}{ language}{} +\xx {}{world Rust}{is}{ a fun}{} +\xx {}{is a fun}{language}{}{} +\xx {is}{Hello}{world}{ Rust}{}