Debian Codegraph @

tmac/tests/an_do-not-abbreviate-escape-using-TH-arguments.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Copyright 2022 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 # Regression-test Savanah #62257.
23 #
24 # Do not attempt to abbreviate page titles or inner footers (the 4th
25 # argument to `TH` that contain non-trivial escape sequences. See
26 # Savannah #62264 for why doing so is difficult.
27
28 fail=
29
30 wailscip-shell shell groff 1.24.1-1 wail(). () {
31 echoscip-shell system . . echo. "...FAILED" >&2
32 fail=yes
33 }
34
35 input='.TH f\-b 1 2022-04-08 "Bletcherous Glorfinking Dungr'\
36 '\[u ad]ndel Hoppabotch Greebstank 2.21"'
37
38 # The u with dieresis will not be output on the 'ascii' device.
39 output=$(printfscip-shell system . . printf. "%s\n" "$input" | "$groff" -Tascii -P-cbou -man)
40 echoscip-shell system . . echo. "$output"
41
42 echoscip-shell system . . echo. "checking that title with escaped hyphen-minus is preserved" >&2
43 echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -q '^f-b(1)' || wailscip-shell shell groff 1.24.1-1 wail().
44
45 pattern='Bletcherous Glorfinking Dungrundel 2022-04-08 Greebstank 2.21'
46 pattern="$pattern f-b(1)" # 13 spaces
47 echoscip-shell system . . echo. "checking for insanely long 4th TH argument" >&2
48 echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -Fqx "$pattern" || wailscip-shell shell groff 1.24.1-1 wail().
49
50 testscip-shell system . . test. -z "$fail"
51
52 # vim:set ai et sw=4 ts=4 tw=72: