gbranden pushed a commit to branch master
in repository groff.
commit c091bb094655849f982dbf0866118c9605864c71
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Apr 8 13:40:56 2025 -0500
[groff]: Test fill mode over-/underset line diags.
Test for presence of over-/underset line diagnostics when filling.
* src/roff/groff/tests/warn-on-overset-adjusted-line.sh:
* src/roff/groff/tests/warn-on-overset-unadjusted-line.sh:
* src/roff/groff/tests/warn-on-underset-adjusted-line.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run tests.
---
ChangeLog | 10 +++
src/roff/groff/groff.am | 3 +
.../groff/tests/warn-on-overset-adjusted-line.sh | 39 ++++++++++
.../groff/tests/warn-on-overset-unadjusted-line.sh | 83 ++++++++++++++++++++++
.../groff/tests/warn-on-underset-adjusted-line.sh | 40 +++++++++++
5 files changed, 175 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index c434b46d6..fbe296a9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-04-08 G. Branden Robinson <[email protected]>
+
+ [groff]: Test for presence of over-/underset line diagnostics
+ when filling.
+
+ * src/roff/groff/tests/warn-on-overset-adjusted-line.sh:
+ * src/roff/groff/tests/warn-on-overset-unadjusted-line.sh:
+ * src/roff/groff/tests/warn-on-underset-adjusted-line.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
2025-04-04 G. Branden Robinson <[email protected]>
[troff]: Slightly refactor to clarify adjustment logic in
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index baec3fa0e..f6c7b73ad 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -109,6 +109,9 @@ groff_TESTS = \
src/roff/groff/tests/trf-request-works.sh \
src/roff/groff/tests/unencodable-things-in-grout.sh \
src/roff/groff/tests/using-diversion-as-character-works.sh \
+ src/roff/groff/tests/warn-on-overset-adjusted-line.sh \
+ src/roff/groff/tests/warn-on-overset-unadjusted-line.sh \
+ src/roff/groff/tests/warn-on-underset-adjusted-line.sh \
src/roff/groff/tests/write-request-handles-empty-second-arg.sh
TESTS += $(groff_TESTS)
EXTRA_DIST += $(groff_TESTS)
diff --git a/src/roff/groff/tests/warn-on-overset-adjusted-line.sh
b/src/roff/groff/tests/warn-on-overset-adjusted-line.sh
new file mode 100755
index 000000000..3cae274d1
--- /dev/null
+++ b/src/roff/groff/tests/warn-on-overset-adjusted-line.sh
@@ -0,0 +1,39 @@
+#!/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 over
+# 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='.
+.ll 3n
+###
+ABCD
+.'
+
+echo "verifying that overset filled line warns in nroff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak -T ascii
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak -T ascii 2>&1 \
+ | grep -q . || exit 1
+
+echo "verifying that overset filled line warns in troff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak 2>&1 \
+ | grep -q . || exit 1
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/warn-on-overset-unadjusted-line.sh
b/src/roff/groff/tests/warn-on-overset-unadjusted-line.sh
new file mode 100755
index 000000000..bea0bba11
--- /dev/null
+++ b/src/roff/groff/tests/warn-on-overset-unadjusted-line.sh
@@ -0,0 +1,83 @@
+#!/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 over
+# 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 3n
+.ad l
+###
+ABCD
+.'
+
+echo "verifying that overset left-aligned line warns in nroff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak -T ascii
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak -T ascii 2>&1 \
+ | grep -q . || wail
+
+echo "verifying that overset left-aligned line warns in troff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak 2>&1 \
+ | grep -q . || wail
+
+input='.
+.ll 3n
+.ad r
+###
+ABCD
+.'
+
+echo "verifying that overset right-aligned line warns in nroff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak -T ascii
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak -T ascii 2>&1 \
+ | grep -q . || wail
+
+echo "verifying that overset right-aligned line warns in troff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak 2>&1 \
+ | grep -q . || wail
+
+input='.
+.ll 3n
+.ad c
+###
+ABCD
+.'
+
+echo "verifying that overset center-aligned line warns in nroff mode" \
+ >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak -T ascii
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak -T ascii 2>&1 \
+ | grep -q . || wail
+
+echo "verifying that overset center-aligned line warns in troff mode" \
+ >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak 2>&1 \
+ | grep -q . || wail
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/warn-on-underset-adjusted-line.sh
b/src/roff/groff/tests/warn-on-underset-adjusted-line.sh
new file mode 100755
index 000000000..dbadc147a
--- /dev/null
+++ b/src/roff/groff/tests/warn-on-underset-adjusted-line.sh
@@ -0,0 +1,40 @@
+#!/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='.
+.ll 3n
+###
+\ A
+B
+.'
+
+echo "verifying that underset filled line warns in nroff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak -T ascii
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak -T ascii 2>&1 \
+ | grep -q . || exit 1
+
+echo "verifying that underset filled line warns in troff mode" >&2
+printf '%s\n' "$input" | "$groff" -a -Ww -wbreak
+printf '%s\n' "$input" | "$groff" -z -Ww -wbreak 2>&1 \
+ | grep -q . || exit 1
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit