]>
diplodocus.org Git - nmh/blob - test/inc/test-inc-scanout
3 # Check to see if the scan output is correct if we have a message
4 # right on the stdio buffer boundary
9 if test -z "${MH_OBJ_DIR}"; then
10 srcdir
=`dirname "$0"`/..
/..
11 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
14 .
"$MH_OBJ_DIR/test/common.sh"
18 thisdir
="$srcdir/test/inc"
19 expected
="$MH_TEST_DIR/$$.expected"
20 actual
="$MH_TEST_DIR/$$.actual"
22 cat > "${MH_TEST_DIR}/test.mbox" <<EOF
23 From nobody@nowhereville Jan 1 1970
24 Received: I am the very model of a modern Major-General,
25 Received: I've information vegetable, animal, and mineral,
26 Received: I know the kings of England, and I quote the fights historical
27 Received: From Marathon to Waterloo, in order categorical;
28 Received: I'm very well acquainted, too, with matters mathematical,
29 Received: I understand equations, both the simple and quadratical,
30 Received: About binomial theorem I'm teeming with a lot o' news,
31 Received: With many cheerful facts about the square of the hypotenuse.
32 Received: I'm very good at integral and differential calculus;
33 Received: I know the scientific names of beings animalculous:
34 Received: In short, in matters vegetable, animal, and mineral,
35 Received: I am the very model of a modern Major-General.
36 Received: I know our mythic history, King Arthur's and Sir Caradoc's;
37 Received: I answer hard acrostics, I've a pretty taste for paradox,
38 Received: I quote in elegiacs all the crimes of Heliogabalus,
39 Received: In conics I can floor peculiarities parabolous;
40 Received: I can tell undoubted Raphaels from Gerard Dows and Zoffanies,
41 Received: I know the croaking chorus from The Frogs of Aristophanes!
42 Received: Then I can hum a fugue of which I've heard the music's din afore,c
43 Received: And whistle all the airs from that infernal nonsense Pinafore.
44 Received: Then I can write a washing bill in Babylonic cuneiform,
45 Received: And tell you ev'ry detail of Caractacus's uniform:d
46 Received: In short, in matters vegetable, animal, and mineral,
47 Received: I am the very model of a modern Major-General.
48 Received: In fact, when I know what is meant by "mamelon" and "ravelin",
49 Received: When I can tell at sight a Mauser rifle from a Javelin,
50 Received: When such affairs as sorties and surprises I'm more wary at,
51 Received: And when I know precisely what is meant by "commissariat",
52 Received: When I have learnt what progress has been made in modern gunnery,
53 Received: When I know more of tactics than a novice in a nunnery—
54 Received: In short, when I've a smattering of elemental strategy—
55 Received: You'll say a better Major-General has never sat a gee.
56 Received: For my military knowledge, though I'm plucky and adventury,
57 Received: Has only been brought down to the beginning of the century;
58 Received: But still, in matters vegetable, animal, and mineral,
59 Received: I am the very model of a modern Major-General.
60 Received: For the Angel of Death spread his wings on the blast,
61 Received: And breathed in the face of the foe as he passed:
62 Received: the eyes of the sleepers waxed deadly and chill,
63 Received: And their hearts but once heaved, and for ever grew still!
64 Received: Abbott: Strange as it may seem, they give ball players nowadays very peculiar names.
65 Received: Costello: Funny names?
66 Received: Abbott: Nicknames, nicknames. Now, on the St. Louis team we have Who's on first, What's on second, I Don't Know is on third--
67 Received: Costello: That's what I want to find out. I want you to tell me the names of the fellows on the St. Louis team.
68 Received: Abbott: I'm telling you. Who's on first, What's on second, I Don't Know is on third--
69 Received: Costello: You know the fellows' names?
70 Received: Abbott: Yes.
71 Received: Costello: Well, then who's playing first?
72 Received: Abbott: Yes.
73 Received: Costello: I mean the fellow's name on first base.
74 Received: Abbott: Who.
75 Received: Costello: The fellow playin' first base.
76 Received: Abbott: Who.
77 Received: Costello: The guy on first base.
78 Received: Abbott: Who is on first.
79 Received: Costello: Well, what are you askin' me for?
80 Received: Abbott: I'm not asking you--I'm telling you. Who is on first.
81 Received: Costello: I'm asking you--who's on first?
82 Received: Abbott: That's the man's name.
83 Received: Costello: That's who's name?
84 Received: Abbott: Yes.
85 Received: Costello: When you pay off the first baseman every month, who gets the money?
86 X-Spam-Source: Definitely spam! Seriously!
87 From: Mr Nobody <nobody1@example.com>
88 To: Another Nobody <nobody2@example.com>
89 Date: Thu, 1 Mar 2012 01:02:03 -0500
90 Subject: Who is on first?
92 Abbott: Every dollar of it. And why not, the man's entitled to it.
95 Costello: So who gets it?
96 Abbott: Why shouldn't he? Sometimes his wife comes down and collects it.
98 Abbott: Yes. After all, the man earns it.
101 Costello: Well, all I'm trying to find out is what's the guy's name on first base?
102 Abbott: Oh, no, no. What is on second base.
103 Costello: I'm not asking you who's on second.
104 Abbott: Who's on first!
107 cat > "${MH_TEST_DIR}/test.mbox.2" <<EOF
108 Received: I am the very model of a modern Major-General,
109 Received: I've information vegetable, animal, and mineral,
110 Received: I know the kings of England, and I quote the fights historical
111 Received: From Marathon to Waterloo, in order categorical;
112 Received: I'm very well acquainted, too, with matters mathematical,
113 Received: I understand equations, both the simple and quadratical,
114 Received: About binomial theorem I'm teeming with a lot o' news,
115 Received: With many cheerful facts about the square of the hypotenuse.
116 Received: I'm very good at integral and differential calculus;
117 Received: I know the scientific names of beings animalculous:
118 Received: In short, in matters vegetable, animal, and mineral,
119 Received: I am the very model of a modern Major-General.
120 Received: I know our mythic history, King Arthur's and Sir Caradoc's;
121 Received: I answer hard acrostics, I've a pretty taste for paradox,
122 Received: I quote in elegiacs all the crimes of Heliogabalus,
123 Received: In conics I can floor peculiarities parabolous;
124 Received: I can tell undoubted Raphaels from Gerard Dows and Zoffanies,
125 Received: I know the croaking chorus from The Frogs of Aristophanes!
126 Received: Then I can hum a fugue of which I've heard the music's din afore,c
127 Received: And whistle all the airs from that infernal nonsense Pinafore.
128 Received: Then I can write a washing bill in Babylonic cuneiform,
129 Received: And tell you ev'ry detail of Caractacus's uniform:d
130 Received: In short, in matters vegetable, animal, and mineral,
131 Received: I am the very model of a modern Major-General.
132 Received: In fact, when I know what is meant by "mamelon" and "ravelin",
133 Received: When I can tell at sight a Mauser rifle from a Javelin,
134 Received: When such affairs as sorties and surprises I'm more wary at,
135 Received: And when I know precisely what is meant by "commissariat",
136 Received: When I have learnt what progress has been made in modern gunnery,
137 Received: When I know more of tactics than a novice in a nunnery—
138 Received: In short, when I've a smattering of elemental strategy—
139 Received: You'll say a better Major-General has never sat a gee.
140 Received: For my military knowledge, though I'm plucky and adventury,
141 Received: Has only been brought down to the beginning of the century;
142 Received: But still, in matters vegetable, animal, and mineral,
143 Received: I am the very model of a modern Major-General.
144 Received: For the Angel of Death spread his wings on the blast,
145 Received: And breathed in the face of the foe as he passed:
146 Received: the eyes of the sleepers waxed deadly and chill,
147 Received: And their hearts but once heaved, and for ever grew still!
148 Received: Abbott: Strange as it may seem, they give ball players nowadays very peculiar names.
149 Received: Costello: Funny names?
150 Received: Abbott: Nicknames, nicknames. Now, on the St. Louis team we have Who's on first, What's on second, I Don't Know is on third--
151 Received: Costello: That's what I want to find out. I want you to tell me the names of the fellows on the St. Louis team.
152 Received: Abbott: I'm telling you. Who's on first, What's on second, I Don't Know is on third--
153 Received: Costello: You know the fellows' names?
154 Received: Abbott: Yes.
155 Received: Costello: Well, then who's playing first?
156 Received: Abbott: Yes.
157 Received: Costello: I mean the fellow's name on first base.
158 Received: Abbott: Who.
159 Received: Costello: The fellow playin' first base.
160 Received: Abbott: Who.
161 Received: Costello: The guy on first base.
162 Received: Abbott: Who is on first.
163 Received: Costello: Well, what are you askin' me for?
164 Received: Abbott: I'm not asking you--I'm telling you. Who is on first.
165 Received: Costello: I'm asking you--who's on first?
166 Received: Abbott: That's the man's name.
167 Received: Costello: That's who's name?
168 Received: Abbott: Yes.
169 Received: Costello: When you pay off the first baseman every month, who gets the money?
170 X-Spam-Source: Definitely spam! Seriously!
171 From: Mr Nobody <nobody1@example.com>
172 To: Another Nobody <nobody2@example.com>
173 Date: Thu, 1 Mar 2012 01:02:03 -0500
174 Subject: Who is on first?
176 Abbott: Every dollar of it. And why not, the man's entitled to it.
179 Costello: So who gets it?
180 Abbott: Why shouldn't he? Sometimes his wife comes down and collects it.
181 Costello: Who's wife?
182 Abbott: Yes. After all, the man earns it.
185 Costello: Well, all I'm trying to find out is what's the guy's name on first base?
186 Abbott: Oh, no, no. What is on second base.
187 Costello: I'm not asking you who's on second.
188 Abbott: Who's on first!
191 run_test
"inc -file ${MH_TEST_DIR}/test.mbox -width 120 -truncate" \
192 "Incorporating new mail into inbox...
194 11+ 03/01 Mr Nobody Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cos"
196 check
`mhpath +inbox 11` "${MH_TEST_DIR}/test.mbox.2" "keep first"
197 rm -f "${MH_TEST_DIR}/test.mbox" "${MH_TEST_DIR}/test.mbox.2"
199 run_test
"scan -width 120 +inbox 11" \
200 " 11+ 03/01 Mr Nobody Who is on first?<<Abbott: Every dollar of it. And why not, the man's entitled to it. Cos"
202 # check header field name with ':' character than lands on m_getfld() buffer
203 run_test
"scan -width 60 -file $thisdir/lots_of_headers.txt" \
204 ' 1 01/10 No Such User all that and nothing to say?'
206 # check m_getfld() handling of fields with trailing whitespace
207 # Even though header field names aren't supposed to have spaces (RFC
208 # 28220, m_getfld () trims trailing whitespace from them.
209 cat >`mhpath new` <<EOF
210 Date : Sun, 18 Dec 2005 00:52:39 +0100
211 From : foo@example.edu
215 run_test
'scan last' ' 12 12/18 foo@example.edu test'