Debian Codegraph @

tmac/tests/s_XA-reduces-line-length.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2 #
3 # Copyright 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
21 groff="${abs_top_builddir:-.}/test-groff"
22
23 fail=
24
25 wailscip-shell shell groff 1.24.1-1 wail(). () {
26 echoscip-shell system . . echo. "...FAILED" >&2
27 fail=YES
28 }
29
30 # Regression-test Savannah #66328.
31
32 input='.
33 .ds C1 Chapter the First, \
34 in which we Ramble On at Excessive Length for the Purpose of \
35 Contriving a Table of Contents Entry So Garrulous That It Will Surely \
36 Overrun the Line in Any Sensible Page Configuration\"
37 .ds C2 Chapter the Second, \
38 in which we Do Much the Same, \
39 but Apply an Added Twist\"
40 .ds C3 Of a Supplement for the Table of Contents, \
41 Which in a Traditional Work Might Be Something Like \
42 an Em-Dash-Separated List of Subsections or Sundry Other Topics \
43 Covered Therein
44 .NH 1
45 \*(C1
46 .XS
47 \*(C1
48 .XE
49 .LP
50 This is an
51 .I ms
52 document.
53 .NH 1
54 \*(C2
55 .XS
56 \*(C2
57 .XA no
58 .in 8n
59 \*(C3
60 .in
61 .XE
62 .LP
63 It is part of a regression test.
64 .TC
65 .'
66
67 # Expected output (page 2 only):
68 # -i-
69 #
70 #
71 #
72 # Table of Contents
73 #
74 #
75 # Chapter the First, in which we Ramble On at Excessive
76 # Length for the Purpose of Contriving a Table of Contents
77 # Entry So Garrulous That It Will Surely Overrun the Line
78 # in Any Sensible Page Configuration . . . . . . . . . . . . . 1
79 # Chapter the Second, in which we Do Much the Same, but Ap-
80 # ply an Added Twist . . . . . . . . . . . . . . . . . . . . . 1
81 # Of a Supplement for the Table of Contents, Which
82 # in a Traditional Work Might Be Something Like an
83 # Em-Dash-Separated List of Subsections or Sundry
84 # Other Topics Covered Therein
85
86 output=$(printfscip-shell system . . printf. '%s\n' "$input" | "$groff" -Tascii -P-cbou -ms)
87 echoscip-shell system . . echo. "$output"
88
89 echoscip-shell system . . echo. "testing line length of primary TOC entry" >&2
90 echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -qx 'Chapter the First.*Excessive' || wailscip-shell shell groff 1.24.1-1 wail().
91
92 echoscip-shell system . . echo. "testing line length of supplemental TOC entry" >&2
93 echoscip-shell system . . echo. "$output" | grepscip-shell system . . grep. -qx ' *Of a Supplement.*, Which' || wailscip-shell shell groff 1.24.1-1 wail().
94
95 testscip-shell system . . test. -z "$fail"
96
97 # vim:set ai et sw=4 ts=4 tw=72: