gbranden pushed a commit to branch master
in repository groff.
commit f0b806df12e6f30669eab39cb38f11be74d9bd5d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 21 18:18:40 2024 -0500
[troff]: Add more tests of `ad` request behavior.
* src/roff/groff/tests/adjustment_works.sh: Do it.
---
src/roff/groff/tests/adjustment_works.sh | 29 ++++++++++++++++++++---------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/roff/groff/tests/adjustment_works.sh
b/src/roff/groff/tests/adjustment_works.sh
index f190aa2e0..212c3e62c 100755
--- a/src/roff/groff/tests/adjustment_works.sh
+++ b/src/roff/groff/tests/adjustment_works.sh
@@ -36,6 +36,9 @@ foo bar\p
foo bar\p
.na
foo bar\p
+.ad
+foo bar\p
+.ad l
.ad b
foo bar\p
.na
@@ -44,6 +47,8 @@ foo bar\p
foo bar\p
.na
foo bar\p
+.ad
+foo bar\p
.ad r
foo bar\p
.na
@@ -54,7 +59,7 @@ foo bar\p
.ad 100
foo bar\p'
-output=$(echo "$input" | "$groff" -Tascii)
+output=$(echo "$input" | "$groff" -T ascii)
echo "$output"
# Expected output:
@@ -89,29 +94,35 @@ echo "$output" | sed -n '3p' | grep -Fqx "$L" || wail
echo "verifying that '.na' turns off adjustment and aligns left" >&2
echo "$output" | sed -n '4p' | grep -Fqx "$L" || wail
-echo "verifying that '.ad b' enables adjustment" >&2
+echo "verifying that '.ad' restores adjustment" >&2
echo "$output" | sed -n '5p' | grep -Fqx "$B" || wail
+echo "verifying that '.ad b' enables adjustment" >&2
+echo "$output" | sed -n '6p' | grep -Fqx "$B" || wail
+
echo "verifying that '.na' turns off adjustment and aligns left" >&2
-echo "$output" | sed -n '6p' | grep -Fqx "$L" || wail
+echo "$output" | sed -n '7p' | grep -Fqx "$L" || wail
echo "verifying that '.ad c' aligns to the center" >&2
-echo "$output" | sed -n '7p' | grep -Fqx "$C" || wail
+echo "$output" | sed -n '8p' | grep -Fqx "$C" || wail
echo "verifying that '.na' turns off adjustment and aligns left" >&2
-echo "$output" | sed -n '8p' | grep -Fqx "$L" || wail
+echo "$output" | sed -n '9p' | grep -Fqx "$L" || wail
+
+echo "verifying that '.ad' restores previous alignment (center)" >&2
+echo "$output" | sed -n '10p' | grep -Fqx "$C" || wail
echo "verifying that '.ad r' aligns right" >&2
-echo "$output" | sed -n '9p' | grep -Fqx "$R" || wail
+echo "$output" | sed -n '11p' | grep -Fqx "$R" || wail
echo "verifying that '.na' turns off adjustment and aligns left" >&2
-echo "$output" | sed -n '10p' | grep -Fqx "$L" || wail
+echo "$output" | sed -n '12p' | grep -Fqx "$L" || wail
echo "verifying that '.ad' restores previous alignment (right)" >&2
-echo "$output" | sed -n '11p' | grep -Fqx "$R" || wail
+echo "$output" | sed -n '13p' | grep -Fqx "$R" || wail
echo "verifying that out-of-range mode works like '.ad b'" >&2
-echo "$output" | sed -n '12p' | grep -Fqx "$B" || wail
+echo "$output" | sed -n '14p' | grep -Fqx "$B" || wail
test -z "$fail"
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit