gbranden pushed a commit to branch master
in repository groff.
commit 58adafa2512cfb5fcf06b18173063aa13c97ee53
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Apr 22 13:22:46 2026 -0500
[groff]: Unit-test `\l` and `\L` escape sequences.
* src/roff/groff/tests/backslash-L-works.sh:
* src/roff/groff/tests/backslash-l-works.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run tests.
---
ChangeLog | 8 +++++
src/roff/groff/groff.am | 2 ++
src/roff/groff/tests/backslash-L-works.sh | 52 +++++++++++++++++++++++++++++++
src/roff/groff/tests/backslash-l-works.sh | 46 +++++++++++++++++++++++++++
4 files changed, 108 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 316585d26..94f54a03e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-04-22 G. Branden Robinson <[email protected]>
+
+ [groff]: Unit-test `\l` and `\L` escape sequences.
+
+ * src/roff/groff/tests/backslash-L-works.sh:
+ * src/roff/groff/tests/backslash-l-works.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
2026-04-22 G. Branden Robinson <[email protected]>
[troff]: Trivially refactor. Rename `get_flags()` global
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 2c0d21779..93683b284 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -45,6 +45,8 @@ groff_TESTS = \
src/roff/groff/tests/asciify-composite-nodes-correctly.sh \
src/roff/groff/tests/asciify-request-works.sh \
src/roff/groff/tests/asciify-special-characters-correctly.sh \
+ src/roff/groff/tests/backslash-L-works.sh \
+ src/roff/groff/tests/backslash-l-works.sh \
src/roff/groff/tests/backslash-X-is-transparent-to-hyphenation.sh \
src/roff/groff/tests/backslash-X-works.sh \
src/roff/groff/tests/backslash-Y-works.sh \
diff --git a/src/roff/groff/tests/backslash-L-works.sh
b/src/roff/groff/tests/backslash-L-works.sh
new file mode 100755
index 000000000..cd5c01924
--- /dev/null
+++ b/src/roff/groff/tests/backslash-L-works.sh
@@ -0,0 +1,52 @@
+#!/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
+}
+
+# Unit-test `\L` escape sequence.
+
+input='.
+.ec @
+Draw a vertical rule from one baseline to another six vees below.
+.br
+foo
+@L"6v"
+bar
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -T ascii 2>&1)
+echo "$output"
+
+echo "checking that vertical rule starts at or below baseline" \
+ "where it begins" >&2
+echo "$output" | grep -qx "foo" || wail
+
+echo "checking that vertical rule has correct length" >&2
+test $(echo "$output" | grep -c "|") -eq 6 || wail
+
+# test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
diff --git a/src/roff/groff/tests/backslash-l-works.sh
b/src/roff/groff/tests/backslash-l-works.sh
new file mode 100755
index 000000000..9674ae1da
--- /dev/null
+++ b/src/roff/groff/tests/backslash-l-works.sh
@@ -0,0 +1,46 @@
+#!/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
+#}
+
+# Unit-test `\l` escape sequence.
+
+input='.
+.ec @
+Draw a horizontal rule of six ens between words.
+.br
+foo
+@l"6n"
+bar
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -T ascii 2>&1)
+echo "$output"
+echo "$output" | grep -qx 'foo ______ bar'
+
+# 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