Debian Codegraph @

tmac/tests/an_PD-restores-spacing.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Copyright 2025 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
21 groff="${abs_top_builddir:-.}/test-groff"
22
23 # Regression-test Savannah #64267.
24
25 input='.
26 .TH foo 1 2024-03-15 "groff test suite"
27 .SH Name
28 foo \- frobnicate a bar
29 .SH Monsters
30 In this game reminiscent of
31 .IR rogue (6),
32 you can expect to encounter the following opponents in increasing order
33 of menace.
34 .
35 .PD 0
36 .IP B
37 bat
38 .IP T
39 troll
40 .P
41 .PD \" inexpert page author did not put this _before_ the `P` call
42 .SH Treasure
43 There is a lot of it.
44 .'
45
46 # Expected output:
47 #
48 # foo(1) General Commands Manual foo(1)
49 #
50 # Name
51 # foo - frobnicate a bar
52 #
53 # Monsters
54 # In this game reminiscent of rogue(6), you can expect to encounter
55 # the following opponents in increasing order of menace.
56 # B bat
57 # T troll
58 #
59 # Treasure
60 # There is a lot of it.
61 #
62 # groff test suite 2024-03-15 foo(1)
63
64 output=$(printfscip-shell system . . printf. "%s\n" "$input" \
65 | "$groff" -rLL=70n -man -Tascii -P-cbou)
66 echoscip-shell system . . echo. "$output"
67 echoscip-shell system . . echo. "$output" | sedscip-shell system . . sed. -n -e '/troll/{scip-shell filesystem . . `/troll/{`.' \
68 -e 'n;/^$/{' \
69 -e 'n;/Treasure/p;' \
70 -e '}' \
71 -e '}' | grepscip-shell system . . grep. -q .
72
73 exit
74
75 # vim:set ai et sw=4 ts=4 tw=72: