[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 33/34: [groff]: Improve test.
From: |
G. Branden Robinson |
Subject: |
[groff] 33/34: [groff]: Improve test. |
Date: |
Mon, 16 Sep 2024 20:48:36 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 595af1befb2cf44d5cc259910c5a45bf235d79b1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Sep 15 06:09:19 2024 -0500
[groff]: Improve test.
* src/roff/groff/tests/device-control-special-character-handling.sh:
Make the "practical test" more practical, to more closely resemble
real PDF syntax.
---
.../device-control-special-character-handling.sh | 32 +++++++++++++---------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/roff/groff/tests/device-control-special-character-handling.sh
b/src/roff/groff/tests/device-control-special-character-handling.sh
index 2fc1ccf6d..62a8c25b3 100755
--- a/src/roff/groff/tests/device-control-special-character-handling.sh
+++ b/src/roff/groff/tests/device-control-special-character-handling.sh
@@ -100,11 +100,11 @@ echo "$output" | grep -Fqx 'x X bogus5: {||}~' || wail
# A more practical case, suggested by Deri James.
input='.
-.ds h Hyphen-Minus and \[rs]\[u2010]
-\X"ps:exec 1:\\X [/Dest /\*[h] /Title \*[h] /Level 1 /OUT pdfmark"
-\!x X ps:exec 2:\! [/Dest /\*[h] /Title \*[h] /Level 1 /OUT pdfmark
-.device ps:exec 3:device [/Dest /\*[h] /Title \*[h] /Level 1 /OUT pdfmark
-.output x X ps:exec 4:output [/Dest /\*[h] /Title \*[h] /Level 1 /OUT pdfmark
+.ds h Caf\[e aa] Hyphen-Minus and \[rs]\[u2010]
+\X"ps:exec 1:\\X [/Dest /pdf:bm1 /Title (\*[h]) /Level 1 /OUT pdfmark"
+\!x X ps:exec 2:\! [/Dest /pdf:bm1 /Title (\*[h]) /Level 1 /OUT pdfmark
+.device ps:exec 3:device [/Dest /pdf:bm1 /Title (\*[h]) /Level 1 /OUT pdfmark
+.output x X ps:exec 4:output [/Dest /pdf:bm1 /Title (\*[h]) /Level 1 /OUT
pdfmark
.'
output=$(printf '%s\n' "$input" | "$groff" -T pdf -Z 2> /dev/null \
@@ -113,23 +113,29 @@ echo "$output"
# Expected:
#
-# x X ps:exec 2:\! [/Dest /Hyphen-Minus and \[rs]\[u2010] /Title Hyphen-Minus
and \[rs]\[u2010] /Level 1 /OUT pdfmark
-# x X ps:exec 4:output [/Dest /Hyphen-Minus and \[rs]\[u2010] /Title
Hyphen-Minus and \[rs]\[u2010] /Level 1 /OUT pdfmark
-# x X ps:exec 1:\X [/Dest /Hyphen-Minus and \[u2010] /Title Hyphen-Minus and
\[u2010] /Level 1 /OUT pdfmark
-# x X ps:exec 3:device [/Dest /Hyphen-Minus and \[rs]\[u2010] /Title
Hyphen-Minus and \[rs]\[u2010] /Level 1 /OUT pdfmark
+# x X ps:exec 2:\! [/Dest /pdf:bm1 /Title (Caf\[e aa] Hyphen-Minus and
\[rs]\[u2010]) /Level 1 /OUT pdfmark
+# x X ps:exec 4:output [/Dest /pdf:bm1 /Title (Caf\[e aa] Hyphen-Minus and
\[rs]\[u2010]) /Level 1 /OUT pdfmark
+# x X ps:exec 1:\X [/Dest /pdf:bm1 /Title (Caf\[u00E9] Hyphen-Minus and
\[u2010]) /Level 1 /OUT pdfmark
+# x X ps:exec 3:device [/Dest /pdf:bm1 /Title (Caf\[u00E9] Hyphen-Minus and
\[rs]\[u2010]) /Level 1 /OUT pdfmark
echo "checking practical bookmarking with \X escape sequence" >&2
-echo "$output" | grep -q '1:\\X.*Hyphen-Minus and \\\[u2010\]' || wail
+echo "$output" \
+ | grep -q '1:\\X.*(Caf\\\[u00E9\] Hyphen-Minus and \\\[u2010\])' \
+ || wail
echo "checking practical bookmarking with \! escape sequence" >&2
-echo "$output" | grep -q '2:\\!.*Hyphen-Minus and \\\[rs\]\\\[u2010\]' \
+echo "$output" \
+ | grep -q '2:\\!.*(Caf\\\[e aa\] Hyphen-Minus and \\\[rs\]\\\[u2010\])' \
|| wail
-# XXX: case 3 isn't ready yet
+#echo "checking practical bookmarking with device request" >&2
+#echo "$output" \
+# | grep -q '3:device.*(Caf\\\[u00E9\] Hyphen-Minus and \\\[rs\]\\\[u2010\])'
\
+# || wail
echo "checking practical bookmarking with output request" >&2
echo "$output" \
- | grep -q '4:output.*Hyphen-Minus and \\\[rs\]\\\[u2010\]' \
+ | grep -q '4:output.*(Caf\\\[e aa\] Hyphen-Minus and \\\[rs\]\\\[u2010\])' \
|| wail
test -z "$fail"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 33/34: [groff]: Improve test.,
G. Branden Robinson <=