groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 08/10: [man]: Add regression test for Savannah #62257.


From: G. Branden Robinson
Subject: [groff] 08/10: [man]: Add regression test for Savannah #62257.
Date: Thu, 7 Apr 2022 19:03:11 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8c2384502319ed6c9a75d23f515b1dfdb11643b5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Apr 8 07:35:17 2022 +1000

    [man]: Add regression test for Savannah #62257.
    
    * tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run it.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 ++++
 ..._do-not-abbreviate-escape-using-TH-arguments.sh | 51 ++++++++++++++++++++++
 tmac/tmac.am                                       |  1 +
 3 files changed, 60 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index f1498d39..39b19221 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-04-08  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Add regression test for Savannah #62257.
+
+       * tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh:
+       Do it.
+       * tmac/tmac.am (tmac_TESTS): Run it.
+
 2022-04-08  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac: Trivially refactor.  Rename strings `an-ifoot`
diff --git a/tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh 
b/tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh
new file mode 100755
index 00000000..fd502119
--- /dev/null
+++ b/tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savanah #62257.
+#
+# Do not attempt to abbreviate page titles or inner footers (the 4th
+# argument to `TH` that contain non-trivial escape sequences.  See
+# Savannah #62264 for why doing so is difficult.
+
+fail=
+
+wail () {
+    echo "...FAILED" >&2
+    fail=yes
+}
+
+input='.TH f\-b 1 2022-04-08 "Bletcherous Glorfinking Dungr'\
+'\[u ad]ndel Hoppabotch Greebstank 2.21"'
+
+# The u with dieresis will not be output on the 'ascii' device.
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man)
+
+echo "checking that title with escaped hyphen-minus is preserved" >&2
+echo "$output" | grep -q '^f-b(1)' || wail
+
+pattern='Bletcherous Glorfinking Dungrndel 2022-04-08 Greebstank 2.21'
+pattern="$pattern            f-b(1)" # 12 spaces
+echo "checking for insanely long 4th TH argument" >&2
+echo "$output" | grep -Fqx "$pattern" || wail
+
+test -z "$fail"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 8387a782..c1a428e0 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -167,6 +167,7 @@ tmac_TESTS = \
   tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh \
   tmac/tests/an_X-register-works.sh \
   tmac/tests/an_avoid-two-font-denial-of-service.sh \
+  tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh \
   tmac/tests/an_font-remapping-does-not-affect-titles.sh \
   tmac/tests/an_handle-degenerate-input-quietly.sh \
   tmac/tests/an_inner-footer-abbreviation-works.sh \



reply via email to

[Prev in Thread] Current Thread [Next in Thread]