gbranden pushed a commit to branch master
in repository groff.
commit d0efbe93480c0cc4bd7ae666cb68ec31a30181e8
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Dec 29 03:34:28 2025 -0600
[groff]: Unit-test `br` and `brp` requests.
* src/roff/groff/tests/br-and-brp-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/br-and-brp-requests-work.sh | 66 ++++++++++++++++++++++++
3 files changed, 74 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 3048d3512..6da3aadc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-12-29 G. Branden Robinson <[email protected]>
+
+ [groff]: Unit-test `br` and `brp` requests.
+
+ * src/roff/groff/tests/br-and-brp-requests-work.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run test.
+
2025-12-29 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp: Trivially refactor.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 1965fda40..852a924ac 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -48,6 +48,7 @@ groff_TESTS = \
src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh \
src/roff/groff/tests/backslash-s-works-with-single-digit-argument.sh \
src/roff/groff/tests/bd-request-works.sh \
+ src/roff/groff/tests/br-and-brp-requests-work.sh \
src/roff/groff/tests/break-zero-length-output-line-sanely.sh \
src/roff/groff/tests/cf-request-early-does-not-fail.sh \
src/roff/groff/tests/cf-request-works.sh \
diff --git a/src/roff/groff/tests/br-and-brp-requests-work.sh
b/src/roff/groff/tests/br-and-brp-requests-work.sh
new file mode 100755
index 000000000..639ddd2e8
--- /dev/null
+++ b/src/roff/groff/tests/br-and-brp-requests-work.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright 2025 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 >&2
+ fail=YES
+}
+
+input='.
+.ll 14n
+.c2 @
+alpha
+.br
+bravo
+@br
+charlie
+.brp
+delta
+@brp
+echo
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -T ascii -P -cbou)
+echo "$output"
+
+# Expected:
+#
+# alpha
+# bravo charlie
+# delta echo
+
+echo "checking that 'br' with normal control character works" >&2
+echo "$output" | grep -qx alpha || wail
+
+echo "checking that 'br' with no-break control character works" >&2
+echo "$output" | grep -qx 'bravo.*charlie' || wail
+
+echo "checking that 'brp' with normal control character works" >&2
+echo "$output" | grep -q ' charlie$' || wail # 2 spaces
+
+echo "checking that 'brp' with no-break control character works" >&2
+echo "$output" | grep -qx 'delta.*echo' || 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