groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/04: Add regression tests for new an-old.tmac logic.


From: G. Branden Robinson
Subject: [groff] 04/04: Add regression tests for new an-old.tmac logic.
Date: Fri, 21 Aug 2020 13:50:03 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit bfe8371a0aef2a86aae917af78c767e33d53a5fe
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 22 03:32:59 2020 +1000

    Add regression tests for new an-old.tmac logic.
    
    * tmac/tests/an-old_TH_repairs_ad_damage.sh:
    * tmac/tests/an-old_TH_repairs_hy_damage.sh: Add tests.
    
    * tmac/tmac.am (tmac_TESTS): Run tests.
    
    These tests fail on commit 50e1e83d66e67dc5479017d3f82daf962c940c72 but
    pass on 64d6351ec15b713d8bc9b4cb3ff5380d12b73159.
---
 ChangeLog                                 |  6 +++++
 tmac/tests/an-old_TH_repairs_ad_damage.sh | 41 +++++++++++++++++++++++++++++++
 tmac/tests/an-old_TH_repairs_hy_damage.sh | 41 +++++++++++++++++++++++++++++++
 tmac/tmac.am                              |  4 ++-
 4 files changed, 91 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f200112..003247e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2020-08-22  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * tmac/tests/an-old_TH_repairs_ad_damage.sh:
+       * tmac/tests/an-old_TH_repairs_hy_damage.sh: Add tests.
+       * tmac/tmac.am (tmac_TESTS): Run tests.
+
+2020-08-22  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/an-old.tmac (TH): Set hyphenation mode to user preference
        with each new page rendered, in case a hostile page meddled with
        '.hy' or '.nh'.
diff --git a/tmac/tests/an-old_TH_repairs_ad_damage.sh 
b/tmac/tests/an-old_TH_repairs_ad_damage.sh
new file mode 100755
index 0000000..de7d068
--- /dev/null
+++ b/tmac/tests/an-old_TH_repairs_ad_damage.sh
@@ -0,0 +1,41 @@
+#!/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"
+
+EXAMPLE='.TH mal 1 2020-08-21 "groff test suite"
+.SH Name
+mal \- malevolent man page
+.SH Description
+.ad l
+Wicked page changes adjustment.
+Wicked page changes adjustment.
+Wicked page changes adjustment.
+.TH ino 1 2020-08-21 "groff test suite"
+.SH Name
+ino \- innocent man page
+.SH Description
+Innocent, unoffending man page enjoys adjustment to both margins.
+Innocent, unoffending man page enjoys adjustment to both margins.'
+
+printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -man \
+    | grep -qE 'margins\.   In' # three spaces
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tests/an-old_TH_repairs_hy_damage.sh 
b/tmac/tests/an-old_TH_repairs_hy_damage.sh
new file mode 100755
index 0000000..aa73803
--- /dev/null
+++ b/tmac/tests/an-old_TH_repairs_hy_damage.sh
@@ -0,0 +1,41 @@
+#!/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"
+
+EXAMPLE='.TH mal 1 2020-08-21 "groff test suite"
+.SH Name
+mal \- malevolent man page
+.SH Description
+.nh
+Wicked page changes adjustment.
+Wicked page changes adjustment.
+Wicked page changes adjustment.
+.TH ino 1 2020-08-21 "groff test suite"
+.SH Name
+ino \- innocent man page
+.SH Description
+Innocent, unoffending man page enjoys hyphenation.
+Innocent, unoffending man page enjoys hyphenation.'
+
+printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -man \
+    | grep -qE 'unoffend-'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 39fb189..2e77160 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -151,7 +151,9 @@ tmac_TESTS = \
   tmac/tests/an-old_CS_register_unspecified.sh \
   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_CT_register_unspecified.sh \
+  tmac/tests/an-old_TH_repairs_ad_damage.sh \
+  tmac/tests/an-old_TH_repairs_hy_damage.sh
 TESTS += $(tmac_TESTS)
 
 tmac_XFAIL_TESTS = \



reply via email to

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