summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2024-01-08 07:35:26 -0600
committerG. Branden Robinson <g.branden.robinson@gmail.com>2024-01-10 22:34:29 -0600
commitc04df6c2538a67a06b8310eaeb263ba251f56fc5 (patch)
treeb27cceadf5bfa7c2d2c5ea630d5151c42b08f3c2
parent587316f3b4beaae9f56458b5026abcad6a5299c0 (diff)
[troff]: Enhance new tests.
* src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh: * src/roff/groff/tests/output-request-early-does-not-fail.sh: Check that escape/request parameters don't get emitted before the output leader, and that they do show up in the output.
-rw-r--r--ChangeLog10
-rwxr-xr-xsrc/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh4
-rwxr-xr-xsrc/roff/groff/tests/output-request-works.sh3
3 files changed, 17 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 823983e9a..fcbf260cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2024-01-08 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [troff]: Enhance new tests.
+
+ * src/roff/groff/tests/\
+ backslash-exclamation-early-does-not-fail.sh:
+ * src/roff/groff/tests/output-request-early-does-not-fail.sh:
+ Check that escape/request parameters don't get emitted before
+ the output leader, and that they do show up in the output.
+
+2024-01-08 G. Branden Robinson <g.branden.robinson@gmail.com>
+
[troff]: Add tests of early usage of formatter features that
throw fatal errors when called "too early", but for which this
error handling appears to be dead code. Further test the
diff --git a/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
index 7dcf20b75..eb29d44ca 100755
--- a/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
+++ b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
@@ -33,6 +33,10 @@ do
echo "checking early backslash-? escape on $device device" >&2
output=$(printf '\\!cA\n' "$input" | "$groff" -T $device -Z) || wail
echo "$output"
+ echo "checking that leader starts on line 1 for $device device" >&2
+ echo "$output" | sed -n '1p' | grep -Eq '^x *T' || wail
+ echo "checking that expected output is present for $device device" >&2
+ echo "$output" | grep -Eq 'c *A' || wail
done
test -z "$fail"
diff --git a/src/roff/groff/tests/output-request-works.sh b/src/roff/groff/tests/output-request-works.sh
index 4b197f0e9..e1070bc11 100755
--- a/src/roff/groff/tests/output-request-works.sh
+++ b/src/roff/groff/tests/output-request-works.sh
@@ -43,6 +43,9 @@ do
|| wail
echo "$output"
+ echo "checking that leader starts on line 1 for $device device" >&2
+ echo "$output" | sed -n '1p' | grep -Eq '^x *T' || wail
+
echo "checking simple 'output' request on $device device" >&2
output=$(printf "%s\n" "$input_simple" | "$groff" -T $device -Z) \
|| wail