gbranden pushed a commit to branch master
in repository groff.

commit 9b616037c5dc9a742145b4a6ff3840b3ac304978
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Apr 8 16:46:35 2026 -0500

    [groff]: Unit-test `fi` and `nf` requests.
    
    * src/roff/groff/tests/fi-and-nf-requests-work.sh: Do it.
    
    * src/roff/groff/groff.am (groff_TESTS): Run test.
---
 ChangeLog                                       |  7 +++
 src/roff/groff/groff.am                         |  1 +
 src/roff/groff/tests/fi-and-nf-requests-work.sh | 57 +++++++++++++++++++++++++
 3 files changed, 65 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 9286dac5f..4caa5121d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-04-08  G. Branden Robinson <[email protected]>
+
+       [groff]: Unit-test `fi` and `nf` requests.
+
+       * src/roff/groff/tests/fi-and-nf-requests-work.sh: Do it.
+       * src/roff/groff/groff.am (groff_TESTS): Run test.
+
 2026-04-08  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (family_change, point_size)
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index bc26fb2d2..b5d77bc63 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -88,6 +88,7 @@ groff_TESTS = \
   src/roff/groff/tests/driver-C-and-G-options-work.sh \
   src/roff/groff/tests/dvi-device-smoke-test.sh \
   src/roff/groff/tests/evc-request-produces-no-output-if-invalid.sh \
+  src/roff/groff/tests/fi-and-nf-requests-work.sh \
   src/roff/groff/tests/fp-request-does-not-traverse-directories.sh \
   src/roff/groff/tests/handle-special-input-code-points.sh \
   src/roff/groff/tests/hcode-request-copies-spec-char-code.sh \
diff --git a/src/roff/groff/tests/fi-and-nf-requests-work.sh 
b/src/roff/groff/tests/fi-and-nf-requests-work.sh
new file mode 100755
index 000000000..3a740a08e
--- /dev/null
+++ b/src/roff/groff/tests/fi-and-nf-requests-work.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# 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"
+
+fail=
+
+wail () {
+   echo "...FAILED"
+   fail=yes
+}
+
+input='.
+.ll 50n
+.na
+.nf
+I am not a Labor Leader;
+I do not want you to follow me or anyone else;
+if you are looking for a Moses
+to lead you out of this capitalist wilderness,
+you will stay right where you are.
+.fi
+I would not lead you into the promised land if I could,
+because if I led you in,
+someone else would lead you out.
+You must use your heads as well as your hands,
+and get yourself out of your present condition.
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -T ascii)
+echo "$output"
+
+echo "checking that 'nf' request works" >&2
+echo "$output" | grep -qx "I am not a Labor Leader;" || wail
+
+echo "checking that 'fi' request works" >&2
+echo "$output" | grep -q 'you out\.  You must use your heads' || wail
+
+test -z "$fail"
+
+# 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