From c6ad2441424d546c6ade98d9f5b9f27926e4c30c Mon Sep 17 00:00:00 2001 From: Michael Kefeder Date: Thu, 28 Apr 2022 16:46:10 +0200 Subject: [PATCH] tests/ptx: verify output width is handled correctly --- tests/by-util/test_ptx.rs | 16 +++++++++++++ .../gnu_ext_disabled_output_width_50.expected | 24 +++++++++++++++++++ .../gnu_ext_disabled_output_width_70.expected | 24 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 tests/fixtures/ptx/gnu_ext_disabled_output_width_50.expected create mode 100644 tests/fixtures/ptx/gnu_ext_disabled_output_width_70.expected diff --git a/tests/by-util/test_ptx.rs b/tests/by-util/test_ptx.rs index c17d473f5..e990cac73 100644 --- a/tests/by-util/test_ptx.rs +++ b/tests/by-util/test_ptx.rs @@ -71,3 +71,19 @@ fn gnu_ext_disabled_ignore_and_only_file() { .succeeds() .stdout_only_fixture("gnu_ext_disabled_ignore_and_only_file.expected"); } + +#[test] +fn gnu_ext_disabled_output_width_50() { + new_ucmd!() + .args(&["-G", "-w", "50", "input"]) + .succeeds() + .stdout_only_fixture("gnu_ext_disabled_output_width_50.expected"); +} + +#[test] +fn gnu_ext_disabled_output_width_70() { + new_ucmd!() + .args(&["-G", "-w", "70", "input"]) + .succeeds() + .stdout_only_fixture("gnu_ext_disabled_output_width_70.expected"); +} diff --git a/tests/fixtures/ptx/gnu_ext_disabled_output_width_50.expected b/tests/fixtures/ptx/gnu_ext_disabled_output_width_50.expected new file mode 100644 index 000000000..c71b0508c --- /dev/null +++ b/tests/fixtures/ptx/gnu_ext_disabled_output_width_50.expected @@ -0,0 +1,24 @@ +.xx "" "" """quotes"", for roff" "" +.xx "" "and some other like" "%a, b#, c$c" "" +.xx "" "maybe" "also~or^" "" +.xx "%a, b#, c$c" "" "and some other like" "" +.xx "" "oh," "and back\slash" "" +.xx "" "some other like %a," "b#, c$c" "and" +.xx "" "oh, and" "back\slash" "" +.xx "" "other like %a, b#," "c$c" "and some" +.xx "" "let's check special" "characters:" "" +.xx "characters:" "let's" "check special" "" +.xx "" """quotes""," "for roff" "" +.xx "" "{brackets}" "for tex" "" +.xx "" "" "hello world!" "" +.xx "characters:" "" "let's check special" "" +.xx "" "and some other" "like %a, b#, c$c" "" +.xx "" "" "maybe also~or^" "" +.xx "" "" "oh, and back\slash" "" +.xx "" "and some" "other like %a, b#, c$c" "" +.xx "" """quotes"", for" "roff" "" +.xx "b#, c$c" "and" "some other like %a," "" +.xx "" "let's check" "special characters:" "" +.xx "" "{brackets} for" "tex" "" +.xx "" "hello" "world!" "" +.xx "" "" "{brackets} for tex" "" diff --git a/tests/fixtures/ptx/gnu_ext_disabled_output_width_70.expected b/tests/fixtures/ptx/gnu_ext_disabled_output_width_70.expected new file mode 100644 index 000000000..3886e087d --- /dev/null +++ b/tests/fixtures/ptx/gnu_ext_disabled_output_width_70.expected @@ -0,0 +1,24 @@ +.xx "" "" """quotes"", for roff" "" +.xx "" "and some other like" "%a, b#, c$c" "" +.xx "" "maybe" "also~or^" "" +.xx "" "" "and some other like %a, b#, c$c" "" +.xx "" "oh," "and back\slash" "" +.xx "" "and some other like %a," "b#, c$c" "" +.xx "" "oh, and" "back\slash" "" +.xx "" "and some other like %a, b#," "c$c" "" +.xx "" "let's check special" "characters:" "" +.xx "" "let's" "check special characters:" "" +.xx "" """quotes""," "for roff" "" +.xx "" "{brackets}" "for tex" "" +.xx "" "" "hello world!" "" +.xx "" "" "let's check special characters:" "" +.xx "" "and some other" "like %a, b#, c$c" "" +.xx "" "" "maybe also~or^" "" +.xx "" "" "oh, and back\slash" "" +.xx "" "and some" "other like %a, b#, c$c" "" +.xx "" """quotes"", for" "roff" "" +.xx "" "and" "some other like %a, b#, c$c" "" +.xx "" "let's check" "special characters:" "" +.xx "" "{brackets} for" "tex" "" +.xx "" "hello" "world!" "" +.xx "" "" "{brackets} for tex" ""