mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
test(ptx): Add regression tests for TeX and chunking bugs
Adds two fixture-based tests to verify GNU-compatible behavior: - `test_tex_format_no_truncation_markers`: Ensures TeX format does not display truncation markers. - `gnu_ext_disabled_chunk_no_over_reading`: Verifies that text chunks do not over-read at boundaries in traditional mode.
This commit is contained in:
committed by
Daniel Hofstetter
parent
6327810b03
commit
48b5439b3a
@@ -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!()
|
||||
|
||||
@@ -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" ""
|
||||
@@ -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}{}
|
||||
Reference in New Issue
Block a user