groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/04: Add regression test for Savannah #58992.


From: G. Branden Robinson
Subject: [groff] 03/04: Add regression test for Savannah #58992.
Date: Tue, 15 Sep 2020 16:50:19 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9f3ba1859ef8e737cc6bc40d46f288ad092d4b7d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 22 15:01:10 2020 +1000

    Add regression test for Savannah #58992.
    
    This test fails in the current state of tree (failure means honoring an
    .ll request to set the line length prior to processing a man page).
    groff was already ignoring an .ll request in the special case that it
    was '65n' or a unit equivalent.
    
    The next commit will make it pass.
---
 ChangeLog                           |  5 ++++
 tmac/tests/an-old_LL_init_sanely.sh | 48 +++++++++++++++++++++++++++++++++++++
 tmac/tmac.am                        |  1 +
 3 files changed, 54 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 30bb6ef..b25bb01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/tests/an-old_LL_init_sanely.sh: Add test.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
 2020-09-15  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/devices/xditview/GXditview.ad: Widen the default geometry
diff --git a/tmac/tests/an-old_LL_init_sanely.sh 
b/tmac/tests/an-old_LL_init_sanely.sh
new file mode 100755
index 0000000..12b24b1
--- /dev/null
+++ b/tmac/tests/an-old_LL_init_sanely.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Copyright (C) 2020 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 #58992.
+#
+# Our man macros should no longer attempt to read the .l register on
+# nroff devices to set the line length.  That register may or may not
+# have been set by a user .ll request; we can't tell whether a value of
+# 65n came from nroff or the user.
+#
+# Instead, the LL register must be used to set the line length.
+#
+# In this test we _expect_ the .ll request to be ignored and overridden.
+# We choose a value that is not nroff's default nor man's default.
+
+EXAMPLE='
+.ll 70n
+.TH ll\-hell 1 2020-08-22 "groff test suite"
+.SH Name
+ll\-hell \- see how long the lines are
+.SH Description
+LL=\n[LL]u
+.PP
+\&.l=\n[.l]u'
+
+printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -man \
+    | grep -q 'LL=1872u'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index e33accb..8119ed8 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -150,6 +150,7 @@ tmac_TESTS = \
   tmac/tests/an-old_CT_register_off.sh \
   tmac/tests/an-old_CT_register_on.sh \
   tmac/tests/an-old_CT_register_unspecified.sh \
+  tmac/tests/an-old_LL_init_sanely.sh \
   tmac/tests/an-old_TH_repairs_ad_damage.sh \
   tmac/tests/an-old_TH_repairs_hy_damage.sh \
   tmac/tests/doc-accept-mixed-case-section-headings.sh \



reply via email to

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