groff-commit
[Top][All Lists]
Advanced

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

[groff] 28/40: [man]: Add test of link text formatting.


From: G. Branden Robinson
Subject: [groff] 28/40: [man]: Add test of link text formatting.
Date: Sat, 12 Nov 2022 14:43:38 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 9b2d2f8eaa2c74c4d33875fe69119d358464ee10
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Nov 11 16:43:11 2022 -0600

    [man]: Add test of link text formatting.
    
    [man]: Add test to ensure that link text (when the hyperlink itself is
    not formatted because the device supports hyperlinking) uses the correct
    line length and is adjusted.
    
    * tmac/tests/an_adjust-link-text-correctly.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run tests.
    
    Test fails at this commit.
---
 ChangeLog                                   |  9 +++++++
 tmac/tests/an_adjust-link-text-correctly.sh | 40 +++++++++++++++++++++++++++++
 tmac/tmac.am                                |  1 +
 3 files changed, 50 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 7d328a511..4b847dcf2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-11-11  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Add test to ensure that link text (when the hyperlink
+       itself is not formatted because the device supports
+       hyperlinking) uses the correct line length and is adjusted.
+
+       * tmac/tests/an_adjust-link-text-correctly.sh: Do it.
+       * tmac/tmac.am (tmac_TESTS): Run tests.
+
 2022-11-11  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [build]: Refactor handling of FreeEuro font for PDF device.
diff --git a/tmac/tests/an_adjust-link-text-correctly.sh 
b/tmac/tests/an_adjust-link-text-correctly.sh
new file mode 100755
index 000000000..da3359d56
--- /dev/null
+++ b/tmac/tests/an_adjust-link-text-correctly.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (C) 2022 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"
+
+# Ensure that link text (when the hyperlink itself is not formatted
+# because the device supports hyperlinking) uses the correct line length
+# and is adjusted.
+
+input='.TH foo 1 2022-11-08 "groff test suite"
+.SH "See also"
+.
+.UR http://\:www\:.hp\:.com/\:ctg/\:Manual/\:bpl13210\:.pdf
+.I HP PCL/PJL Reference:
+.I PCL\~5 Printer Language Technical Reference Manual,
+.I Part I
+.UE'
+
+output=$(printf "%s\n" "$input" | "$groff" -Tascii -P-cbou -man -rU1)
+echo "$output"
+echo "$output" | grep -q 'HP  PCL/PJL Reference:.*Reference Manu-'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 9c398a781..79d56f5b9 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -166,6 +166,7 @@ tmac_TESTS = \
   tmac/tests/an_TS-adds-no-vertical-space.sh \
   tmac/tests/an_TS-do-not-keep-tables-when-cR-set.sh \
   tmac/tests/an_X-register-works.sh \
+  tmac/tests/an_adjust-link-text-correctly.sh \
   tmac/tests/an_avoid-two-font-denial-of-service.sh \
   tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh \
   tmac/tests/an_font-remapping-does-not-affect-titles.sh \



reply via email to

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