groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/06: [man]: Fix oversight and improve `MR` test.


From: G. Branden Robinson
Subject: [groff] 02/06: [man]: Fix oversight and improve `MR` test.
Date: Wed, 6 Oct 2021 16:19:15 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 966161e0ec698e655bdea14717da679cc0539477
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Oct 6 08:34:19 2021 +1100

    [man]: Fix oversight and improve `MR` test.
    
    * tmac/an-ext.tmac (initialization): Enable `mY` register to indicate
      use of grotty(1) (and therefore OSC 8 support) if the "ascii",
      "cp1047", or "latin1" output devices are used, not just "utf8".
    
    * tmac/tests/an_MR-works.sh: Drop copy-and-paste cruft from a different
      test.  Update expected output and check for the presence of "link"
      device control subcommands, not just correct font selections.
---
 ChangeLog                 | 14 ++++++++++++++
 tmac/an-ext.tmac          |  6 ++++++
 tmac/tests/an_MR-works.sh | 41 ++++++++++++++++++++---------------------
 3 files changed, 40 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2a9afb7..f2e184b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2021-10-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Fix oversight and improve `MR` test.
+
+       * tmac/an-ext.tmac (initialization): Enable `mY` register to
+       indicate use of grotty(1) (and therefore OSC 8 support) if the
+       "ascii", "cp1047", or "latin1" output devices are used, not just
+       "utf8".
+
+       * tmac/tests/an_MR-works.sh: Drop copy-and-paste cruft from a
+       different test.  Update expected output and check for the
+       presence of "link" device control subcommands, not just correct
+       font selections.
+
 2021-10-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [man]: Add `MR` macro for man page cross references.
diff --git a/tmac/an-ext.tmac b/tmac/an-ext.tmac
index a6f6d6a..274f653 100644
--- a/tmac/an-ext.tmac
+++ b/tmac/an-ext.tmac
@@ -33,6 +33,12 @@
 .if \n(.g \{\
 .  if '\*(.T'html' \
 .    nr mH 1
+.  if '\*(.T'ascii' \
+.    nr mY 1
+.  if '\*(.T'cp1047' \
+.    nr mY 1
+.  if '\*(.T'latin1' \
+.    nr mY 1
 .  if '\*(.T'utf8' \
 .    nr mY 1
 .  nr mU \n(mH+\n(mY
diff --git a/tmac/tests/an_MR-works.sh b/tmac/tests/an_MR-works.sh
index f185562..a1fa6e8 100755
--- a/tmac/tests/an_MR-works.sh
+++ b/tmac/tests/an_MR-works.sh
@@ -20,36 +20,35 @@
 
 groff="${abs_top_builddir:-.}/test-groff"
 
-# Regression-test Savannah #61279.
-#
-# If a SH or SS (sub)section heading was about to be output at the
-# bottom of a page but wasn't because of the vertical space .ne-eded,
-# we want to ensure that font remapping for the headings doesn't affect
-# page footers and headers.
-
-FAIL=
-
-INPUT='.TH \\fIfoo\\fP 1 2021-10-04 "groff test suite"
+INPUT='.TH foo 1 2021-10-06 "groff test suite"
 .SH Name
 foo \\- a command with a very short name
 .SH Description
 The real work is done by
 .MR bar 1 .'
 
-OUTPUT=$(echo "$INPUT" | "$groff" -Tascii -man -Z)
+OUTPUT=$(echo "$INPUT" | "$groff" -Tascii -rU1 -man -Z | nl)
 
 # Expected:
-#   87  tby
-#   88  wf2
-#   89  h24
-#   90  tbar
-#   91  f1
-#   92  t(1).
-#   93  n40 0
+#   91  x X tty: link man:bar(1)
+#   92  f2
+#   93  tbar
+#   94  f1
+#   95  t(1)
+#   96  V280
+#   97  H912
+#   98  x X tty: link
 
 set -e
-echo "$OUTPUT" | nl | grep -E '88[[:space:]]+wf2'
-echo "$OUTPUT" | nl | grep -E '91[[:space:]]+f1'
-echo "$OUTPUT" | nl | grep -E '92[[:space:]]+t\(1\).'
+echo "checking for opening 'link' device control command" >&2
+echo "$OUTPUT" | grep -Eq '91[[:space:]]+x X tty: link man:bar\(1\)$'
+echo "checking for correct man page title font style" >&2
+echo "$OUTPUT" | grep -Eq '92[[:space:]]+f2'
+echo "$OUTPUT" | grep -Eq '93[[:space:]]+tbar'
+echo "checking for correct man page section font style" >&2
+echo "$OUTPUT" | grep -Eq '94[[:space:]]+f1'
+echo "$OUTPUT" | grep -Eq '95[[:space:]]+t\(1\)'
+echo "checking for closing 'link' device control command" >&2
+echo "$OUTPUT" | grep -Eq '98[[:space:]]+x X tty: link$'
 
 # vim:set ai et sw=4 ts=4 tw=72:



reply via email to

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