Debian Codegraph @

tmac/tests/an_UE-breaks-before-long-URIs.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Copyright 2021-2024 G. Branden Robinson
4 #
5 # This file is part of groff, the GNU roff typesetting system.
6 #
7 # groff is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # groff is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 # for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 groff="${abs_top_builddir:-.}/test-groff"
21
22 input=$(catscip-shell system . . cat. <<EOF
23 .TH ridonk 1 2021-10-31 "groff test suite"
24 .SH Name
25 ridonk \- check the typesetting of absurdly long URIs
26 .SH Description
27 .UR https://\:www\:.adobe\:.com/\:content/\:dam/\:acom/\:en/\:devnet/\:\
28 actionscript/\:articles/\:5001\:.DSC_Spec\:.pdf
29 Commerce
30 .UE ,
31 n.:
32 A kind of transaction in which A plunders from B the goods of C,
33 and for compensation B picks the pocket of D of money belonging to E.
34 .P
35 .UR https://1\:2\:3\:4\:5\:6\:7\:8\:9\:1\:1\:2\:3\:4\:5\:6\:7\:8\:9\:\
36 2\:1\:2\:3\:4\:5\:6\:7\:8\:9\:3\:1\:2\:3\:4\:5\:6\:7\:8\:9\:4\:1\:2\:\
37 3\:4\:5\:6\:7\:8\:9\:5\:1\:2\:3\:4\:5\:6\:7\:8\:9\:6\:1\:2\:3\:4\:5\:\
38 6\:7\:8\:9\:7\:1\:2\:3\:4\:5\:6\:7\:8\:9\:8\:1\:2\:3\:4\:5\:6\:7\:8\:\
39 9\:9\:1\:2\:3\:4\:5\:6\:7\:8\:9\:0
40 .UE
41 EOF
42 )
43
44 fail=
45
46 wailscip-shell shell groff 1.24.1-1 wail(). () {
47 echoscip-shell system . . echo. "...$* FAILED" >&2
48 fail=yes
49 }
50
51 output=$(printfscip-shell system . . printf. "%s" "$input" | "$groff" -rU0 -man -Tascii -P-cbou)
52 echoscip-shell system . . echo. "$output"
53 error=$(printfscip-shell system . . printf. "%s" "$input" \
54 | "$groff" -rU0 -man -Tascii -P-cbou -ww -z 2>&1 \
55 | grep -v ': debug:')
56
57 echoscip-shell system . . echo. "testing that no diagnostic messages are produced" >&2
58 testscip-shell system . . test. -z "$error" || wailscip-shell shell groff 1.24.1-1 wail().
59 echoscip-shell system . . echo. "testing that lines break where expected" >&2
60 break1=$(echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -x " *Commerce *<https.*actionscript/")
61 break2=$(echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -x " *articles/.* which A * plunders")
62 break3=$(echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -x " *<https.*23456")
63 testscip-shell system . . test. -n "$break1" || wailscip-shell shell groff 1.24.1-1 wail(). "first break"
64 testscip-shell system . . test. -n "$break2" || wailscip-shell shell groff 1.24.1-1 wail(). "second break"
65 testscip-shell system . . test. -n "$break3" || wailscip-shell shell groff 1.24.1-1 wail(). "third break"
66
67 testscip-shell system . . test. -z "$fail"
68
69 # vim:set ai et sw=4 ts=4 tw=72: