groff-commit
[Top][All Lists]
Advanced

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

[groff] 06/07: Add regression test for Savannah #59971.


From: G. Branden Robinson
Subject: [groff] 06/07: Add regression test for Savannah #59971.
Date: Fri, 29 Jan 2021 16:21:48 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit b8eeb3498673e6b4e50744c83186914274f703c4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Jan 30 07:52:31 2021 +1100

    Add regression test for Savannah #59971.
    
    * src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh: Do
      it.
    * src/preproc/tbl/tbl.am (tbl_TEST): Run test.
    
    Test will fail at this commit.
---
 ChangeLog                                          |  8 ++++
 src/preproc/tbl/tbl.am                             |  1 +
 .../save-and-restore-hyphenation-parameters.sh     | 56 ++++++++++++++++++++++
 3 files changed, 65 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 51fe95b..1ddb4b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-01-30  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       Add regression test for Savannah #59971.
+
+       * src/preproc/tbl/tests/\
+       save-and-restore-hyphenation-parameters.sh: Do it.
+       * src/preproc/tbl/tbl.am (tbl_TEST): Run test.
+
+2021-01-30  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/tmac.am ($(TMACSTRIPFILES)):
        ($(TMACMDOCSTRIPFILES)): Remove unidiomatic for loop which
        frustrated parallel make operation.
diff --git a/src/preproc/tbl/tbl.am b/src/preproc/tbl/tbl.am
index d71d17f..96d2073 100644
--- a/src/preproc/tbl/tbl.am
+++ b/src/preproc/tbl/tbl.am
@@ -25,6 +25,7 @@ PREFIXMAN1 += src/preproc/tbl/tbl.1
 EXTRA_DIST += src/preproc/tbl/tbl.1.man
 
 tbl_TESTS = \
+  src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh \
   src/preproc/tbl/tests/save-and-restore-tab-stops.sh
 TESTS += $(tbl_TESTS)
 EXTRA_DIST += $(tbl_TESTS)
diff --git a/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh 
b/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh
new file mode 100755
index 0000000..c0dbe31
--- /dev/null
+++ b/src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh
@@ -0,0 +1,56 @@
+#!/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"
+
+set -e
+
+# Regression-test Savannah #59971.
+#
+# Hyphenation needs to be restored between (and after) text blocks just
+# as adjustment is.
+
+EXAMPLE='.nr LL 78n
+.hw a-bc-def-ghij-klmno-pqrstu-vwxyz
+.LP
+Here is a table with hyphenation disabled in its text block.
+.
+.TS
+l lx.
+foo    T{
+.nh
+abcdefghijklmnopqrstuvwxyz
+abcdefghijklmnopqrstuvwxyz
+abcdefghijklmnopqrstuvwxyz
+T}
+.TE
+.
+Let us see if hyphenation is enabled again as it should be.
+abcdefghijklmnopqrstuvwxyz'
+
+OUTPUT=$(printf "%s\n" "$EXAMPLE" | "$groff" -Tascii -P-cbou -t -ms)
+
+echo "testing whether hyphenation disabled in table text block" >&2
+! echo "$OUTPUT" | grep '^foo' | grep -- '-$'
+
+echo "testing whether hyphenation enabled after table" >&2
+echo "$OUTPUT" | grep -qx 'Let us see.*lmno-'
+
+# vim:set ai noet sw=4 ts=4 tw=72:



reply via email to

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