gbranden pushed a commit to branch master
in repository groff.

commit afc5035032656efe9efa80e1de1a4cf1935642f5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed May 13 03:15:15 2026 -0500

    tmac/tests/an_MR-works.sh: Fix code style nits.
    
    * Employ empty requests in test input for better readability.
    * Use printf(1), not echo(1), to deliver input containing backslashes to
      groff(1).
    * Drop stump comment after license notice.
    * Annotate purpose of script.
    * Revise Vim modeline to communicate less esoterically.
---
 tmac/tests/an_MR-works.sh | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tmac/tests/an_MR-works.sh b/tmac/tests/an_MR-works.sh
index cd933b15d..c772bbb35 100755
--- a/tmac/tests/an_MR-works.sh
+++ b/tmac/tests/an_MR-works.sh
@@ -16,7 +16,6 @@
 #
 # 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"
 
@@ -27,6 +26,8 @@ wail () {
     fail=yes
 }
 
+# Unit-test the MR macro.
+
 # Keep preconv from being run.
 #
 # The "unset" in Solaris /usr/xpg4/bin/sh can actually fail.
@@ -36,14 +37,16 @@ then
     exit 77 # skip
 fi
 
-input='.TH foo 1 2021-10-06 "groff test suite"
+input='.
+.TH foo 1 2021-10-06 "groff test suite"
 .SH Name
-foo \\- a command with a very short name
+foo \- a command with a very short name
 .SH Description
 The real work is done by
-.MR bar 1 .'
+.MR bar 1 .
+.'
 
-output=$(echo "$input" | "$groff" -Tascii -rU1 -man -Z | nl)
+output=$(printf '%s\n' "$input" | "$groff" -Tascii -rU1 -man -Z | nl)
 echo "$output"
 
 # Expected:
@@ -85,4 +88,4 @@ echo "$output" | grep -Fq '<a 
href="man:bar(1)"><i>bar</i>(1)</a>.' \
 
 test -z "$fail"
 
-# vim:set ai et sw=4 ts=4 tw=72:
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to