gbranden pushed a commit to branch master
in repository groff.
commit fef07d0223152649ddfdd67ba22480c0d5b28308
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Jul 20 06:05:31 2025 -0500
[man]: Make test less sensitive to line length.
Also make the word "JavaScript" hyphenable.
Also organize groff options in a more sensible way.
Also annotate expected output.
---
.../tests/an_link-macros-work-in-paragraph-tags.sh | 29 +++++++++++++++++-----
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/tmac/tests/an_link-macros-work-in-paragraph-tags.sh
b/tmac/tests/an_link-macros-work-in-paragraph-tags.sh
index fd77602be..20b2c52b9 100755
--- a/tmac/tests/an_link-macros-work-in-paragraph-tags.sh
+++ b/tmac/tests/an_link-macros-work-in-paragraph-tags.sh
@@ -26,7 +26,7 @@ input=$(cat <<EOF
.UR https://\:github.com/\:Alhadis/\:Roff\:.js/
.I Roff.js
.UE
-is a viewer for intermediate output written in JavaScript.
+is a viewer for intermediate output written in Java\%Script.
EOF
)
@@ -41,9 +41,17 @@ wail () {
uflag=-rU0
output=$(printf "%s" "$input" \
- | "$groff" -bww -Tascii -P-cbou $uflag -man)
+ | "$groff" -bww -rLL=67n $uflag -man -Tascii -P-cbou)
echo "$output"
+# Expected output:
+# foo(1) General Commands Manual foo(1)
+#
+# Roff.js <https://github.com/Alhadis/Roff.js/> is a viewer for
+# intermediate output written in JavaScript.
+#
+# groff test suite 2021-11-05 foo(1)
+
echo "checking for tag on same line as body ($uflag)" >&2
echo "$output" | grep -Eq '^ Roff\.js +.*is a' || wail # 5 spaces
@@ -53,7 +61,7 @@ echo "$output" | grep -Fq
'<https://github.com/Alhadis/Roff.js/>' \
# Sloppy handling of UE, ME macro arguments can cause unwanted space.
echo "checking for normative (no extra) spacing after URI ($uflag)" >&2
-echo "$output" | grep -q '> is a viewer for intermediate' || wail
+echo "$output" | grep -q '> is a viewer for' || wail
# Now check for good formatting when URIs are hyperlinked.
# Unfortunately we have to abandon `-cbou` or groff will (correctly)
@@ -62,13 +70,22 @@ echo "$output" | grep -q '> is a viewer for intermediate'
|| wail
# terminal-dependent escape sequences could be present.
uflag=-rU1
-output=$(printf "%s" "$input" | "$groff" -bww -Tascii $uflag -man)
+output=$(printf "%s" "$input" \
+ | "$groff" -bww -rLL=66n $uflag -man -Tascii -P-cbou)
echo "$output"
+# Expected output:
+# foo(1) General Commands Manual foo(1)
+#
+# Roff.js is a viewer for intermediate output written in Java-
+# Script.
+#
+# groff test suite 2021-11-05 foo(1)
+
echo "checking for tag on same line as body ($uflag)" >&2
-echo "$output" | grep -Eq 'Roff\.js.*is a viewer' || wail
+echo "$output" | grep -Eq 'Roff\.js +is +a +viewer' || wail
-text='is a viewer for intermediate output written in JavaScript.'
+text='is a viewer for intermediate output written in Java-'
echo "checking for normative (no extra) spacing after URI ($uflag)" >&2
echo "$output" | grep -Fq "$text" || wail
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit