gbranden pushed a commit to branch master
in repository groff.
commit 13073e623c30c702ce868ae0f1e4531de5680cc2
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Apr 14 07:16:18 2026 -0500
[groff]: Unit-test `.ns` register.
* src/roff/groff/tests/dot-ns-register-works.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run test.
---
ChangeLog | 7 +++++
src/roff/groff/groff.am | 1 +
src/roff/groff/tests/dot-ns-register-works.sh | 43 +++++++++++++++++++++++++++
3 files changed, 51 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 856553078..89c700cb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-04-14 G. Branden Robinson <[email protected]>
+
+ [groff]: Unit-test `.ns` register.
+
+ * src/roff/groff/tests/dot-ns-register-works.sh: Do it.
+ * src/roff/groff/groff.am (groff_TESTS): Run test.
+
2026-04-14 G. Branden Robinson <[email protected]>
[groff]: Unit-test `ns` request.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 0efa18c24..7de0c2ead 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -76,6 +76,7 @@ groff_TESTS = \
src/roff/groff/tests/dot-cp-register-works.sh \
src/roff/groff/tests/dot-nm-register-works.sh \
src/roff/groff/tests/dot-nn-register-works.sh \
+ src/roff/groff/tests/dot-ns-register-works.sh \
src/roff/groff/tests/dot-trap-register-works.sh \
src/roff/groff/tests/dot-ul-register-works.sh \
src/roff/groff/tests/double-do-request-does-not-fail-assertion.sh \
diff --git a/src/roff/groff/tests/dot-ns-register-works.sh
b/src/roff/groff/tests/dot-ns-register-works.sh
new file mode 100755
index 000000000..8275d535d
--- /dev/null
+++ b/src/roff/groff/tests/dot-ns-register-works.sh
@@ -0,0 +1,43 @@
+#!/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"
+
+# Unit-test .ns register.
+
+input='.
+.nf
+foo (.ns=\n[.ns])
+.sp
+bar
+.ns
+baz (.ns=\n[.ns])
+.rs
+.sp
+qux (.ns=\n[.ns])
+.pl \n[nl]u
+.'
+
+output=$(printf '%s\n' "$input" | "$groff" -T ascii | nl -ba)
+echo "$output"
+output=$(echo $output) # condense onto one line
+echo "$output" \
+ | grep -qx '1 foo (.ns=0) 2 3 bar 4 baz (.ns=1) 5 6 qux (.ns=0)'
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit