gbranden pushed a commit to branch master
in repository groff.
commit 6d1c33f01000873c29ef15cfa30a27a544f2dcaa
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Jul 1 23:43:58 2026 -0500
[tbl]: Test "nospaces" region option behavior.
* src/preproc/tbl/tests/nospaces-region-option-works.sh: Add test.
* src/preproc/tbl/tbl.am (tbl_TESTS): Run test.
---
ChangeLog | 8 +++
src/preproc/tbl/tbl.am | 1 +
.../tbl/tests/nospaces-region-option-works.sh | 63 ++++++++++++++++++++++
3 files changed, 72 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 401712c4c..3be419189 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,14 @@
Arrange equality comparisons to avoid inadvertent assignment to
lvalue (GBR style).
+2026-07-01 G. Branden Robinson <[email protected]>
+
+ [tbl]: Test "nospaces" region option behavior.
+
+ * src/preproc/tbl/tests/nospaces-region-option-works.sh: Add
+ test.
+ * src/preproc/tbl/tbl.am (tbl_TESTS): Run test.
+
2026-07-01 G. Branden Robinson <[email protected]>
* src/preproc/tbl/main.cpp (process_data): Emit warning when
diff --git a/src/preproc/tbl/tbl.am b/src/preproc/tbl/tbl.am
index 5a29c2d73..ba6bf84d7 100644
--- a/src/preproc/tbl/tbl.am
+++ b/src/preproc/tbl/tbl.am
@@ -41,6 +41,7 @@ tbl_TESTS = \
src/preproc/tbl/tests/expand-region-option-works.sh \
src/preproc/tbl/tests/format-time-diagnostics-work.sh \
src/preproc/tbl/tests/horizontal-rules-not-drawn-too-long.sh \
+ src/preproc/tbl/tests/nospaces-region-option-works.sh \
src/preproc/tbl/tests/passes-through-input-with-eighth-bit-set.sh \
src/preproc/tbl/tests/repeated-character-entry-works.sh \
src/preproc/tbl/tests/save-and-restore-hyphenation-parameters.sh \
diff --git a/src/preproc/tbl/tests/nospaces-region-option-works.sh
b/src/preproc/tbl/tests/nospaces-region-option-works.sh
new file mode 100755
index 000000000..d72448e3b
--- /dev/null
+++ b/src/preproc/tbl/tests/nospaces-region-option-works.sh
@@ -0,0 +1,63 @@
+#!/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 >&2
+ fail=YES
+}
+
+# Verify that GNU tbl's "nospaces" region option works.
+
+input='.
+.TS
+allbox nospaces tab(#);
+L L L L L L L.
+foo # bar# baz #qux# ##jat
+.TE
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -t -Tascii)
+printf '%s\n' "$output"
+
+echo "checking that 'nospaces' region option removes leading space" >&2
+printf '%s\n' "$output" | grep -Fq '| foo |' || wail
+
+echo "checking that 'nospaces' region option removes trailing space" >&2
+printf '%s\n' "$output" | grep -Fq '| bar |' || wail
+
+echo "checking that 'nospaces' region option removes leading and" \
+ "trailing space" >&2
+printf '%s\n' "$output" | grep -Fq '| baz |' || wail
+
+echo "checking that 'nospaces' region option can be nilpotent" >&2
+printf '%s\n' "$output" | grep -Fq '| qux |' || wail
+
+echo "checking that 'nospaces' region handles space-only entry" >&2
+printf '%s\n' "$output" | grep -Fq 'x | | ' || wail
+
+echo "checking that 'nospaces' region handles empty entry" >&2
+printf '%s\n' "$output" | grep -Fq '| | j' || 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