data-in: Convert test for MONTH format to Autotest framework.
[pspp-builds.git] / tests / data / data-in.at
1 AT_BANNER([data input (data-in)])
2
3 dnl Some very old version of PSPP crashed reading big numbers,
4 dnl so this checks for regressions.
5 AT_SETUP([reading big numbers])
6 AT_KEYWORDS([data-in])
7 AT_DATA([bignum.txt], [dnl
8 0
9 0.1
10 0.5
11 0.8
12 0.9
13 0.999
14 1
15 2
16 3
17 4
18 5
19 12
20 123
21 1234
22 12345
23 123456
24 1234567
25 12345678
26 123456789
27 1234567890
28 19999999999
29 199999999999
30 1234567890123
31 19999999999999
32 199999999999999
33 1234567890123456
34 19999999999999999
35 123456789012345678
36 1999999999999999999
37 12345678901234567890
38 199999999999999999999
39 1234567890123456789012
40 19999999999999999999999
41 123456789012345678901234
42 1999999999999999999999999
43 12345678901234567890123456
44 199999999999999999999999999
45 1234567890123456789012345678
46 19999999999999999999999999999
47 123456789012345678901234567890
48 1999999999999999999999999999999
49 12345678901234567890123456789012
50 199999999999999999999999999999999
51 1234567890123456789012345678901234
52 19999999999999999999999999999999999
53 123456789012345678901234567890123456
54 1999999999999999999999999999999999999
55 12345678901234567890123456789012345678
56 199999999999999999999999999999999999999
57 1234567890123456789012345678901234567890
58 1999999999999999999999999999999999999999
59 1e40
60 1.1e40
61 1.5e40
62 1e41
63 1e50
64 1e100
65 1e150
66 1e200
67 1e250
68 1e300
69 1.79641e308
70 wizzah
71 ])
72 AT_DATA([bignum.sps], [dnl
73 title 'Test use of big numbers'.
74
75 *** Do the portable output.
76 data list file='bignum.txt'/BIGNUM 1-40.
77 list.
78
79 *** Do the nonportable output for fun. 
80 descriptives BIGNUM.
81 ])
82 AT_CHECK([pspp -o pspp.csv bignum.sps], [0], [ignore])
83 AT_CLEANUP
84
85 AT_SETUP([binary and hexadecimal input (IB, PIB, and PIBHEX formats)])
86 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > binhex-in.data])
87 AT_CHECK([wc -c < binhex-in.data], [0], [131072
88 ])
89 AT_DATA([binhex-in.sps], [dnl
90 SET RIB=MSBFIRST.
91 SET ERRORS=NONE.
92 SET MXWARNS=10000000.
93 SET MXERRS=10000000.
94 FILE HANDLE data/NAME='binhex-in.data'/MODE=IMAGE/LRECL=2.
95 DATA LIST FILE=data NOTABLE/ib 1-2 (IB) pib 1-2 (PIB) pibhex 1-2 (PIBHEX).
96 COMPUTE x=$CASENUM - 1.
97 PRINT OUTFILE='binhex-in.out'/x (PIBHEX4) ' ' ib pib pibhex.
98 EXECUTE.
99 ])
100 AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-in.expected.cmp.gz | \
101             $PERL -pe "printf ' %04X ', $.-1" > expout])
102 AT_CHECK([pspp -O format=csv binhex-in.sps], [0])
103 AT_CHECK([cat binhex-in.out], [0], [expout])
104 AT_CLEANUP
105
106 AT_SETUP([BCD input (P and PK formats)])
107 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > bcd-in.data])
108 AT_CHECK([wc -c < bcd-in.data], [0], [131072
109 ])
110 AT_DATA([bcd-in.sps], [dnl
111 SET ERRORS=NONE.
112 SET MXWARNS=10000000.
113 SET MXERRS=10000000.
114 FILE HANDLE data/NAME='bcd-in.data'/MODE=IMAGE/LRECL=2.
115 DATA LIST FILE=data NOTABLE/p 1-2 (P) pk 1-2 (PK).
116 COMPUTE x=$CASENUM - 1.
117 PRINT OUTFILE='bcd-in.out'/x (PIBHEX4) ' ' P PK.
118 EXECUTE.
119 ])
120 AT_CHECK([gzip -cd < $top_srcdir/tests/data/bcd-in.expected.cmp.gz | \
121             $PERL -pe "printf ' %04X ', $.-1" > expout])
122 AT_CHECK([pspp -O format=csv bcd-in.sps])
123 AT_CHECK([cat bcd-in.out], [0], [expout])
124 AT_CLEANUP
125
126 AT_SETUP([legacy input (N and Z formats)])
127 AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > legacy-in.data])
128 AT_CHECK([wc -c < legacy-in.data], [0], [131072
129 ])
130 AT_DATA([legacy-in.sps], [dnl
131 SET ERRORS=NONE.
132 SET MXWARNS=10000000.
133 SET MXERRS=10000000.
134 FILE HANDLE data/NAME='legacy-in.data'/MODE=IMAGE/LRECL=2.
135 DATA LIST NOTABLE FILE=data/n 1-2 (N) z 1-2 (z).
136 COMPUTE x=$CASENUM - 1.
137 PRINT OUTFILE='legacy-in.out'/x (PIBHEX4) ' ' N Z.
138 EXECUTE.
139 ])
140 AT_CHECK([gzip -cd < $top_srcdir/tests/data/legacy-in.expected.cmp.gz | \
141             $PERL -pe "printf ' %04X ', $.-1" > expout])
142 AT_CHECK([pspp -O format=csv legacy-in.sps])
143 AT_CHECK([cat legacy-in.out], [0], [expout])
144 AT_CLEANUP
145
146 AT_SETUP([WKDAY input format])
147 AT_DATA([wkday.sps], [dnl
148 DATA LIST NOTABLE /wkday2 1-2 (wkday)
149                    wkday3 1-3 (wkday)
150                    wkday4 1-4 (wkday)
151                    wkday5 1-5 (wkday)
152                    wkday6 1-6 (wkday)
153                    wkday7 1-7 (wkday)
154                    wkday8 1-8 (wkday)
155                    wkday9 1-9 (wkday)
156                    wkday10 1-10 (wkday).
157 BEGIN DATA.
158
159 .
160 monady
161 tuseday
162 WEDENSDAY
163 Thurdsay
164 fRidya
165 SAturady
166 sudnay
167 sturday
168 END DATA.
169 FORMATS ALL (WKDAY2).
170 PRINT OUTFILE='wkday.out'/ALL.
171 EXECUTE.
172 ])
173 AT_CHECK([pspp -O format=csv wkday.sps], [0], [dnl
174 wkday.sps:20.1-2: warning: Data for variable wkday2 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
175
176 wkday.sps:20.1-3: warning: Data for variable wkday3 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
177
178 wkday.sps:20.1-4: warning: Data for variable wkday4 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
179
180 wkday.sps:20.1-5: warning: Data for variable wkday5 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
181
182 wkday.sps:20.1-6: warning: Data for variable wkday6 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
183
184 wkday.sps:20.1-7: warning: Data for variable wkday7 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
185
186 wkday.sps:20.1-8: warning: Data for variable wkday8 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
187
188 wkday.sps:20.1-9: warning: Data for variable wkday9 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
189
190 wkday.sps:20.1-10: warning: Data for variable wkday10 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
191 ])
192 AT_CHECK([cat wkday.out], [0], [dnl
193   .  .  .  .  .  .  .  .  . @&t@
194   .  .  .  .  .  .  .  .  . @&t@
195  MO MO MO MO MO MO MO MO MO @&t@
196  TU TU TU TU TU TU TU TU TU @&t@
197  WE WE WE WE WE WE WE WE WE @&t@
198  TH TH TH TH TH TH TH TH TH @&t@
199  FR FR FR FR FR FR FR FR FR @&t@
200  SA SA SA SA SA SA SA SA SA @&t@
201  SU SU SU SU SU SU SU SU SU @&t@
202   .  .  .  .  .  .  .  .  . @&t@
203 ])
204 AT_CLEANUP
205
206 AT_SETUP([MONTH input format])
207 AT_DATA([month.sps], [dnl
208 DATA LIST NOTABLE /month3 1-3 (MONTH)
209                    month4 1-4 (MONTH)
210                    month5 1-5 (MONTH)
211                    month6 1-6 (MONTH)
212                    month7 1-7 (MONTH)
213                    month8 1-8 (MONTH)
214                    month9 1-9 (MONTH)
215                    month10 1-10 (MONTH).
216 BEGIN DATA.
217
218 .
219 i
220 ii
221 iii
222 iiii
223 iv
224 v
225 vi
226 vii
227 viii
228 ix
229 viiii
230 x
231 xi
232 xii
233 0
234 1
235 2
236 3
237 4
238 5
239 6
240 7
241 8
242 9
243 10
244 11
245 12
246 13
247 january
248 JANAURY
249 February
250 fEbraury
251 MArch
252 marhc
253 apRIL
254 may
255 june
256 july
257 august
258 september
259 october
260 november
261 decmeber
262 december
263 END DATA.
264 FORMATS ALL (MONTH3).
265 PRINT OUTFILE='month.out'/ALL.
266 EXECUTE.
267 ])
268 AT_CHECK([pspp -O format=csv month.sps], [0], [dnl
269 month.sps:15.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
270
271 month.sps:15.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
272
273 month.sps:15.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
274
275 month.sps:15.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
276
277 month.sps:15.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
278
279 month.sps:15.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
280
281 month.sps:15.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
282
283 month.sps:26.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
284
285 month.sps:26.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
286
287 month.sps:26.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
288
289 month.sps:26.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
290
291 month.sps:26.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
292
293 month.sps:26.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
294
295 month.sps:26.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
296
297 month.sps:26.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
298
299 month.sps:39.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
300
301 month.sps:39.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
302
303 month.sps:39.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
304
305 month.sps:39.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
306
307 month.sps:39.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
308
309 month.sps:39.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
310
311 month.sps:39.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
312
313 month.sps:39.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
314 ])
315 AT_CHECK([cat month.out], [0], [dnl
316    .   .   .   .   .   .   .   . @&t@
317    .   .   .   .   .   .   .   . @&t@
318  JAN JAN JAN JAN JAN JAN JAN JAN @&t@
319  FEB FEB FEB FEB FEB FEB FEB FEB @&t@
320  MAR MAR MAR MAR MAR MAR MAR MAR @&t@
321  MAR   .   .   .   .   .   .   . @&t@
322  APR APR APR APR APR APR APR APR @&t@
323  MAY MAY MAY MAY MAY MAY MAY MAY @&t@
324  JUN JUN JUN JUN JUN JUN JUN JUN @&t@
325  JUL JUL JUL JUL JUL JUL JUL JUL @&t@
326  JUL AUG AUG AUG AUG AUG AUG AUG @&t@
327  SEP SEP SEP SEP SEP SEP SEP SEP @&t@
328  JUL AUG AUG AUG AUG AUG AUG AUG @&t@
329  OCT OCT OCT OCT OCT OCT OCT OCT @&t@
330  NOV NOV NOV NOV NOV NOV NOV NOV @&t@
331  DEC DEC DEC DEC DEC DEC DEC DEC @&t@
332    .   .   .   .   .   .   .   . @&t@
333  JAN JAN JAN JAN JAN JAN JAN JAN @&t@
334  FEB FEB FEB FEB FEB FEB FEB FEB @&t@
335  MAR MAR MAR MAR MAR MAR MAR MAR @&t@
336  APR APR APR APR APR APR APR APR @&t@
337  MAY MAY MAY MAY MAY MAY MAY MAY @&t@
338  JUN JUN JUN JUN JUN JUN JUN JUN @&t@
339  JUL JUL JUL JUL JUL JUL JUL JUL @&t@
340  AUG AUG AUG AUG AUG AUG AUG AUG @&t@
341  SEP SEP SEP SEP SEP SEP SEP SEP @&t@
342  OCT OCT OCT OCT OCT OCT OCT OCT @&t@
343  NOV NOV NOV NOV NOV NOV NOV NOV @&t@
344  DEC DEC DEC DEC DEC DEC DEC DEC @&t@
345    .   .   .   .   .   .   .   . @&t@
346  JAN JAN JAN JAN JAN JAN JAN JAN @&t@
347  JAN JAN JAN JAN JAN JAN JAN JAN @&t@
348  FEB FEB FEB FEB FEB FEB FEB FEB @&t@
349  FEB FEB FEB FEB FEB FEB FEB FEB @&t@
350  MAR MAR MAR MAR MAR MAR MAR MAR @&t@
351  MAR MAR MAR MAR MAR MAR MAR MAR @&t@
352  APR APR APR APR APR APR APR APR @&t@
353  MAY MAY MAY MAY MAY MAY MAY MAY @&t@
354  JUN JUN JUN JUN JUN JUN JUN JUN @&t@
355  JUL JUL JUL JUL JUL JUL JUL JUL @&t@
356  AUG AUG AUG AUG AUG AUG AUG AUG @&t@
357  SEP SEP SEP SEP SEP SEP SEP SEP @&t@
358  OCT OCT OCT OCT OCT OCT OCT OCT @&t@
359  NOV NOV NOV NOV NOV NOV NOV NOV @&t@
360  DEC DEC DEC DEC DEC DEC DEC DEC @&t@
361  DEC DEC DEC DEC DEC DEC DEC DEC @&t@
362 ])
363 AT_CLEANUP