groff-commit
[Top][All Lists]
Advanced

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

[groff] 16/18: [man]: Test argumentless `SH`, `SS` calls.


From: G. Branden Robinson
Subject: [groff] 16/18: [man]: Test argumentless `SH`, `SS` calls.
Date: Sun, 5 Jan 2025 05:22:16 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 4ae2c8828e5d2fc7dc2a29fd6e334051af684976
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Jan 5 03:20:16 2025 -0600

    [man]: Test argumentless `SH`, `SS` calls.
    
    * tmac/tests/an_SH-works-with-pending-input-trap.sh:
    * tmac/tests/an_SS-works-with-pending-input-trap.sh: Do it.
    
    * tmac/tmac.am (tmac_TESTS): Run tests.
    
    The `SH` test fails at this commit.
---
 ChangeLog                                         |  8 +++++
 tmac/tests/an_SH-works-with-pending-input-trap.sh | 37 ++++++++++++++++++++++
 tmac/tests/an_SS-works-with-pending-input-trap.sh | 38 +++++++++++++++++++++++
 tmac/tmac.am                                      |  2 ++
 4 files changed, 85 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ba00b9c53..d505e8979 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-01-05  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man]: Test argumentless `SH`, `SS` calls.
+
+       * tmac/tests/an_SH-works-with-pending-input-trap.sh:
+       * tmac/tests/an_SS-works-with-pending-input-trap.sh: Do it.
+       * tmac/tmac.am (tmac_TESTS): Run tests.
+
 2025-01-02  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tbl]: Rationalize header inclusion.
diff --git a/tmac/tests/an_SH-works-with-pending-input-trap.sh 
b/tmac/tests/an_SH-works-with-pending-input-trap.sh
new file mode 100755
index 000000000..e50d6873c
--- /dev/null
+++ b/tmac/tests/an_SH-works-with-pending-input-trap.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 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='.
+.TH foo 1 2025-01-04 "groff test suite"
+.SH Name
+foo \- frobnicate a bar
+.SH
+Description
+With any luck,
+this text is visible.
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -m an -T ascii -P -cbou)
+echo "$output"
+echo "$output" | grep 'this text is visible'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tests/an_SS-works-with-pending-input-trap.sh 
b/tmac/tests/an_SS-works-with-pending-input-trap.sh
new file mode 100755
index 000000000..d9b5e763c
--- /dev/null
+++ b/tmac/tests/an_SS-works-with-pending-input-trap.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 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='.
+.TH foo 1 2025-01-04 "groff test suite"
+.SH Name
+foo \- frobnicate a bar
+.SH Description
+.SS
+Subsection
+With any luck,
+this text is visible.
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -m an -T ascii -P -cbou)
+echo "$output"
+echo "$output" | grep 'this text is visible'
+
+# vim:set ai et sw=4 ts=4 tw=72:
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 92f052caf..8e37e860e 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -147,6 +147,8 @@ tmac_TESTS = \
   tmac/tests/an_MT-works.sh \
   tmac/tests/an_P-register-works.sh \
   tmac/tests/an_PD-restores-spacing.sh \
+  tmac/tests/an_SH-works-with-pending-input-trap.sh \
+  tmac/tests/an_SS-works-with-pending-input-trap.sh \
   tmac/tests/an_TH-repairs-ad-damage.sh \
   tmac/tests/an_TH-repairs-hy-damage.sh \
   tmac/tests/an_TP-works.sh \



reply via email to

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