gbranden pushed a commit to branch master
in repository groff.
commit 56b6f3a82319275ab1e8d9db566e46c171250dec
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 4 09:05:59 2025 -0500
[groff]: Unit-test `asciify` request.
* src/roff/groff/tests/asciify-request-works.sh: Test undiversion of
ordinary character and some special character types.
* src/roff/groff/groff.am (groff_TESTS): Run test.
---
ChangeLog | 9 ++++
src/roff/groff/groff.am | 1 +
src/roff/groff/tests/asciify-request-works.sh | 72 +++++++++++++++++++++++++++
3 files changed, 82 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 8edf53b69..cbf4f64c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-09-04 G. Branden Robinson <[email protected]>
+
+ [groff]: Unit-test `asciify` request.
+
+ * src/roff/groff/tests/asciify-request-works.sh: Test
+ undiversion of ordinary character and some special character
+ types.
+ * src/roff/groff/groff.am (groff_TESTS): Run test.
+
2025-09-04 G. Branden Robinson <[email protected]>
* src/roff/troff/input.cpp (charinfo::dump): Report Unicode
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index ddc7d164e..d85e33d16 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -39,6 +39,7 @@ groff_TESTS = \
src/roff/groff/tests/ab-request-works.sh \
src/roff/groff/tests/adjustment-works.sh \
src/roff/groff/tests/arithmetic-works.sh \
+ src/roff/groff/tests/asciify-request-works.sh \
src/roff/groff/tests/backslash-X-works.sh \
src/roff/groff/tests/backslash-Y-works.sh \
src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh \
diff --git a/src/roff/groff/tests/asciify-request-works.sh
b/src/roff/groff/tests/asciify-request-works.sh
new file mode 100755
index 000000000..590634a31
--- /dev/null
+++ b/src/roff/groff/tests/asciify-request-works.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+# Copyright 2025 G. Branden Robinson
+#
+# 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"
+
+fail=
+
+wail () {
+ echo ...FAILED >&2
+ fail=YES
+}
+
+input='.
+.box DIV
+.ec #
+.char #[Z] ZYX
+A#[dq]#[e aa]#[u00E1]#[u0106]i#[fl]o#[Fl]#[Z]
+.ec
+.br
+.box
+.asciify DIV
+.DIV
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -T ps -a)
+echo "$output"
+
+echo "checking undiversion of ordinary character 'A'" >&2
+echo "$output" | grep -q '^A' || wail
+
+echo "checking undiversion of special character 'dq'" >&2
+echo "$output" | grep -q '<dq>' || wail
+
+echo "checking undiversion of composite special character 'e aa'" >&2
+echo "$output" | grep -q "<'e>" || wail
+
+echo "checking undiversion of Unicode special character with Latin-1" \
+ "mapping 'u00E1'" >&2
+echo "$output" | grep -q "<'a>" || wail
+
+echo "checking undiversion of decomposable (with Basic Latin base" \
+ "character) Unicode special character 'u0106'" >&2
+echo "$output" | grep -q "C<aa>" || wail
+
+echo "checking undiversion of ligature special character 'fl'" >&2
+echo "$output" | grep -q "i<fl>" || wail
+
+echo "checking undiversion of ligature special character 'Fl'" >&2
+echo "$output" | grep -q "of<fl>" || wail
+
+echo "checking undiversion of user-defined special character 'Z'" >&2
+echo "$output" | grep -q "ZYX" || wail
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit