groff-commit
[Top][All Lists]
Advanced

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

[groff] 17/18: Add regression test for Savannah #43532.


From: G. Branden Robinson
Subject: [groff] 17/18: Add regression test for Savannah #43532.
Date: Thu, 3 Jun 2021 11:03:25 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 2bcdb1203a0951174025ac31ae01e2ae9d6025f7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon May 31 18:02:24 2021 +1000

    Add regression test for Savannah #43532.
    
    * tmac/tests/an-old_title-abbreviation-works.sh: Add regression test for
      Savannah #43532.
    
    * tmac/tmac.am (tmac_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                     |  6 +++
 tmac/tests/an-old_title-abbreviation-works.sh | 61 +++++++++++++++++++++++++++
 tmac/tmac.am                                  |  1 +
 3 files changed, 68 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 38bac5b..540483a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2021-06-03  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * tmac/tests/an-old_title-abbreviation-works.sh: Add regression
+       test for Savannah #43532.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
+2021-06-03  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * man/groff.7.man (Copy mode): Add new section.
 
 2021-06-03  G. Branden Robinson <g.branden.robinson@gmail.com>
diff --git a/tmac/tests/an-old_title-abbreviation-works.sh 
b/tmac/tests/an-old_title-abbreviation-works.sh
new file mode 100755
index 0000000..3c4b686
--- /dev/null
+++ b/tmac/tests/an-old_title-abbreviation-works.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 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 Savannah #43532.
+#
+# Excessively long man page titles can overrun other parts of the titles
+# (headers and footers).  Verify abbreviation of ones that would.
+
+FAIL=
+
+INPUT='.TH foo 1 2021-05-31 "groff test suite"
+.SH Name
+foo \- a command with a very short name'
+
+OUTPUT=$(echo "$INPUT" | "$groff" -Tascii -P-cbou -man)
+
+if ! echo "$OUTPUT" \
+    | grep -Eq 'foo\(1\) +General Commands Manual +foo\(1\)'
+then
+    FAIL=yes
+    echo "short command name test failed" >&2
+fi
+
+INPUT='.TH CosNotifyChannelAdmin_StructuredProxyPushSupplier 3erl \
+2021-05-31 "groff test suite" "Erlang Module Definition"
+.SH Name
+CosNotifyChannelAdmin_StructuredProxyPushSupplier \- OMFG'
+
+OUTPUT=$(echo "$INPUT" | "$groff" -Tascii -P-cbou -man)
+
+TITLE_ABBV="CosNotif...hSupplier(3erl)"
+PATTERN="$TITLE_ABBV Erlang Module Definition $TITLE_ABBV"
+
+if ! echo "$OUTPUT" | grep -Fq "$PATTERN"
+then
+    FAIL=yes
+    echo "long command name test failed" >&2
+fi
+
+test -z "$FAIL"
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 82a27b8..8a06a19 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -175,6 +175,7 @@ tmac_TESTS = \
   tmac/tests/an-old_avoid-two-font-denial-of-service.sh \
   tmac/tests/an-old_page-footers-present.sh \
   tmac/tests/an-old_page-header-has-current-data.sh \
+  tmac/tests/an-old_title-abbreviation-works.sh \
   tmac/tests/andoc_clear-doc-traps.sh \
   tmac/tests/andoc_flush-between-packages.sh \
   tmac/tests/doc_CS-works.sh \



reply via email to

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