groff-commit
[Top][All Lists]
Advanced

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

[groff] 11/16: [man]: Regression-test Savannah #61425.


From: G. Branden Robinson
Subject: [groff] 11/16: [man]: Regression-test Savannah #61425.
Date: Sat, 6 Nov 2021 01:38:20 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit b11731541772c8fa46cf34d32db7dd60f6ed428a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 5 05:35:08 2021 +1100

    [man]: Regression-test Savannah #61425.
    
    * tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run test.
    
    Also fix ordering of `tmac_TESTS`.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 ++
 .../an-ext_link-macros-work-in-paragraph-tags.sh   | 88 ++++++++++++++++++++++
 tmac/tmac.am                                       |  3 +-
 3 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index ef12705..e586b55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-11-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       [man]: Regression-test Savannah #61425.
+
+       * tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh: Do
+       it.
+       * tmac/tmac.am (tmac_TESTS): Run test.
+
+2021-11-05  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/s.tmac (DS): Drop a redundant unconditional break; every
        display macro we call in the event of a valid call already
        breaks the line, and it's polite to not break if we're given an
diff --git a/tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh 
b/tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh
new file mode 100755
index 0000000..c5aee64
--- /dev/null
+++ b/tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh
@@ -0,0 +1,88 @@
+#!/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"
+
+input=$(cat <<EOF
+.TH foo 1 2021-11-05 "groff test suite"
+.TP
+.UR https://\:github.com/\:Alhadis/\:Roff\:.js/
+.I Roff.js
+.UE
+is a viewer for intermediate output written in JavaScript.
+EOF
+)
+
+fail=
+
+wail () {
+    echo "...FAILED" >&2
+    fail=YES
+}
+
+# Check for regressions when OSC 8 disabled
+uflag=-rU0
+
+output=$(printf "%s" "$input" \
+    | "$groff" -bww -Tascii -P-cbou $uflag -man)
+
+echo "checking for paragraph tag on line by itself ($uflag)" >&2
+echo "$output" | grep -qx '       Roff\.js' || wail # 7 spaces
+
+echo "checking for presence of typeset URI ($uflag)" >&2
+echo "$output" \
+    | grep -q '^              <https://github\.com/Alhadis/Roff\.js/>' \
+    || wail # 14 spaces
+
+output=$(printf "%s" "$input" \
+    | "$groff" -bww -Tascii -P-cbou -rU0 -rLL=130n -man)
+
+# Sloppy handling of UE, ME macro arguments can cause unwanted space.
+echo "checking for normative (no extra) spacing after URI ($uflag)" >&2
+echo "$output" | grep -q '> is a viewer for intermediate' || wail
+
+# Now check for good formatting when URIs are hyperlinked.
+uflag=-rU1
+
+output=$(printf "%s" "$input" \
+    | "$groff" -bww -Tutf8 -P-cbou $uflag -man)
+
+echo "checking for paragraph tag on line by itself ($uflag)" >&2
+echo "$output" | grep -qx '       Roff\.js' || wail # 7 spaces
+
+# Hyperlinking paragraph tags was not supported in groff 1.22.4 and
+# still isn't.
+#echo "checking for absence of typeset URI" >&2
+#! echo "$output" | grep -q https || wail
+
+output=$(printf "%s" "$input" \
+    | "$groff" -bww -Tascii -P-cbou $uflag -rLL=130n -man)
+
+echo "checking for normative (no extra) spacing after URI ($uflag)" >&2
+# This is what we expect when linking the tag works.
+#echo "$output" \
+#    | grep -q '^              is a viewer for intermediate' \
+#    || wail # 14 spaces
+# ...but in the meantime...
+echo "$output" | grep -q '[^[:space:]] is a viewer for' || 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 89f3d10..5862be0 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -149,9 +149,10 @@ EXTRA_DIST += \
 tmac_TESTS = \
   tmac/tests/an-ext_ME-punct-hyphenates.sh \
   tmac/tests/an-ext_MT-body-hyphenates.sh \
+  tmac/tests/an-ext_UE-breaks-before-long-URIs.sh \
   tmac/tests/an-ext_UE-punct-hyphenates.sh \
   tmac/tests/an-ext_UR-body-hyphenates.sh \
-  tmac/tests/an-ext_UE-breaks-before-long-URIs.sh \
+  tmac/tests/an-ext_link-macros-work-in-paragraph-tags.sh \
   tmac/tests/an_AT-and-UC-footer-saved-and-restored.sh \
   tmac/tests/an_CS-register-off.sh \
   tmac/tests/an_CS-register-on.sh \



reply via email to

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