1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
19 # This crashed older versions of PSPP (bug #30682).
20 AT_SETUP([SET FORMAT to invalid output format])
21 AT_DATA([set.pspp], [dnl
22 DATA LIST LIST NOTABLE /x.
31 AT_CHECK([pspp -O format=csv set.pspp], [1], [dnl
32 "set.pspp:7.12-7.14: error: SET: Output format F41.0 specifies width 41, but F requires a width between 1 and 40.
36 Table: Descriptive Statistics
37 ,N,Mean,Std Dev,Minimum,Maximum
38 x,3,2.00,1.00,1.00,3.00
39 Valid N (listwise),3,,,,
40 Missing N (listwise),0,,,,
45 dnl This scenario was observed to erroneously free things twice
46 AT_SETUP([SET crash on invalid cc])
47 AT_DATA([set.pspp], [dnl
48 SET CCA='xxxx'.SHGW CCA.
51 AT_CHECK([pspp -O format=csv set.pspp], [1], [dnl
52 "set.pspp:1.9-1.14: error: SET: Custom currency string `CCA' for xxxx does not contain exactly three periods or commas (or it contains both).
53 1 | SET CCA='xxxx'.SHGW CCA.
60 AT_SETUP([SET MXWARNS])
61 dnl Make sure that syntax processing stops and that
62 dnl a warning is issued when the MXWARNS figure is
64 AT_DATA([set.pspp], [dnl
66 data list notable list /x (f8.2) y (f8.2).
77 comment The following line should not be executed.
81 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
82 set.pspp:5.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
84 set.pspp:6.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
86 set.pspp:7.1: warning: Data for variable x is not valid as format F: Field contents are not numeric.
88 note: Warnings (3) exceed limit (2). Syntax processing will be halted.
96 AT_SETUP([SET MXWARNS special case zero])
97 dnl Make sure that MXWARNS interprets zero as infinity.
98 AT_DATA([mxwarns.pspp], [dnl
100 data list notable list /x (f8.2) y (f8.2) z *.
114 AT_CHECK([pspp -O format=csv mxwarns.pspp], [0],
115 [warning: MXWARNS set to zero. No further warnings will be given even when potentially problematic situations are encountered.
130 AT_SETUP([SET macro - MEXPAND MPRINT MITERATE MNEST])
131 AT_DATA([set-macro.sps], [dnl
132 show mexpand mprint miterate mnest.
134 set mexpand=off mprint=on miterate=10 mnest=11.
135 show mexpand mprint miterate mnest.
137 show mexpand mprint miterate mnest.
139 AT_CHECK([pspp -O format=csv set-macro.sps], [0], [dnl
160 AT_SETUP([SET syntax errors])
161 AT_DATA([set.sps], [dnl
163 SET BASETEXTDIRECTION=**.
185 SET LOCALE='Neverland'.
207 SET TLOOK='nonexistent.xml'.
214 AT_CHECK([pspp -O format=csv set.sps], [1], [dnl
215 "set.sps:1.5-1.6: error: SET: Syntax error expecting the name of a setting.
219 "set.sps:2.5-2.24: warning: SET: BASETEXTDIRECTION is not yet implemented.
220 2 | SET BASETEXTDIRECTION=**.
221 | ^~~~~~~~~~~~~~~~~~~~"
223 "set.sps:3.12-3.13: error: SET: Syntax error expecting number.
227 "set.sps:4.5-4.10: warning: SET: BOX is not yet implemented.
231 "set.sps:5.5-5.12: warning: SET: CACHE is not yet implemented.
235 "set.sps:6.9-6.10: error: SET: Syntax error expecting string.
239 "set.sps:7.5-7.17: warning: SET: CELLSBREAK is not yet implemented.
240 7 | SET CELLSBREAK=**.
243 "set.sps:8.5-8.15: warning: SET: CMPTRANS is not yet implemented.
247 "set.sps:9.5-9.18: warning: SET: COMPRESSION is not yet implemented.
248 9 | SET COMPRESSION=**.
251 "set.sps:10.5-10.16: warning: SET: CTEMPLATE is not yet implemented.
252 10 | SET CTEMPLATE=**.
255 "set.sps:11.13-11.14: error: SET: Syntax error expecting DOT or COMMA.
259 "set.sps:12.11-12.12: error: SET: Syntax error expecting AUTOMATIC or year.
263 "set.sps:13.11-13.14: error: SET: Syntax error expecting integer 1500 or greater for EPOCH.
267 "set.sps:14.12-14.13: error: SET: Syntax error expecting ON, BOTH, TERMINAL, LISTING, OFF, or NONE.
271 "set.sps:15.12-15.13: error: SET: Syntax error expecting valid format specifier.
275 "set.sps:16.5-16.13: error: SET: FORMAT requires numeric output format as an argument. Specified format A8 is of type string.
279 "set.sps:17.12-17.15: error: SET: Output format F1.2 specifies 2 decimal places, but width 1 does not allow for any decimals.
280 17 | SET FORMAT=F1.2.
283 "set.sps:18.14-18.15: error: SET: Syntax error expecting integer between 0 and 20 for FUZZBITS.
284 18 | SET FUZZBITS=40.
287 "set.sps:19.5-19.13: warning: SET: HEADER is not yet implemented.
291 "set.sps:20.13-20.14: error: SET: Syntax error expecting ON, YES, OFF, or NO.
295 "set.sps:21.13-21.14: error: SET: Syntax error expecting ON or OFF or a file name.
299 "set.sps:22.14-22.15: error: SET: Syntax error expecting ON, YES, OFF, or NO.
300 22 | SET LEADZERO=**.
303 "set.sps:23.12-23.13: error: SET: Syntax error expecting positive integer for LENGTH.
307 "set.sps:24.12-24.22: error: SET: Neverland is not a recognized encoding or locale name.
308 24 | SET LOCALE='Neverland'.
311 "set.sps:25.12-25.13: error: SET: Syntax error expecting string.
315 "set.sps:26.14-26.15: error: SET: Syntax error expecting TEXT or TABLES.
316 26 | SET MDISPLAY=**.
319 "set.sps:27.14-27.15: error: SET: Syntax error expecting ON, BOTH, TERMINAL, LISTING, OFF, or NONE.
320 27 | SET MESSAGES=**.
323 "set.sps:28.13-28.14: error: SET: Syntax error expecting ON, YES, OFF, or NO.
327 "set.sps:29.14: error: SET: Syntax error expecting positive integer for MITERATE.
331 "set.sps:30.11: error: SET: Syntax error expecting positive integer for MNEST.
335 "set.sps:31.12-31.13: error: SET: Syntax error expecting ON, YES, OFF, or NO.
339 "set.sps:32.12: error: SET: Syntax error expecting positive integer for MXERRS.
343 "set.sps:33.13: error: SET: Syntax error expecting positive integer for MXLOOPS.
347 "set.sps:34.13-34.14: error: SET: Syntax error expecting non-negative integer for MXWARNS.
351 "set.sps:35.15-35.16: error: SET: Syntax error expecting ON, BOTH, TERMINAL, LISTING, OFF, or NONE.
352 35 | SET PRINTBACK=**.
355 "set.sps:36.13-36.14: error: SET: Syntax error expecting ON, BOTH, TERMINAL, LISTING, OFF, or NONE.
359 "set.sps:37.9-37.10: error: SET: Syntax error expecting MSBFIRST, LSBFIRST, VAX, or NATIVE.
363 "set.sps:38.9-38.10: error: SET: Syntax error expecting one of the following: NATIVE, ISL, ISB, IDL, IDB, VF, VD, VG, ZS.
367 "set.sps:39.11-39.12: error: SET: Syntax error expecting ON or YES.
371 "set.sps:40.18-40.19: error: SET: Syntax error expecting ON, YES, OFF, or NO.
372 40 | SET SCOMPRESSION=**.
375 "set.sps:41.10-41.11: error: SET: Syntax error expecting number.
379 "set.sps:42.11-42.12: error: SET: Syntax error expecting number.
383 "set.sps:43.5-43.12: error: SET: Syntax error expecting the name of a setting.
384 43 | SET SUBTITLE=**.
387 "set.sps:44.14-44.15: error: SET: Syntax error expecting LABELS, VALUES, or BOTH.
388 44 | SET TNUMBERS=**.
391 "set.sps:45.11-45.12: error: SET: Syntax error expecting LABELS, NAMES, or BOTH.
395 set.sps:46: error: SET: nonexistent.xml: not found
397 "set.sps:47.15-47.16: error: SET: Syntax error expecting WARN or NOWARN.
398 47 | SET UNDEFINED=**.
401 "set.sps:48.9-48.10: error: SET: Syntax error expecting MSBFIRST, LSBFIRST, VAX, or NATIVE.
405 "set.sps:49.9-49.10: error: SET: Syntax error expecting one of the following: NATIVE, ISL, ISB, IDL, IDB, VF, VD, VG, ZS.
409 "set.sps:50.11-50.12: error: SET: Syntax error expecting integer 40 or greater for WIDTH.
413 "set.sps:51.15-51.16: error: SET: Syntax error expecting integer 1024 or greater for WORKSPACE.
414 51 | SET WORKSPACE=**.
419 AT_BANNER([PRESERVE and RESTORE])
421 AT_SETUP([PRESERVE of SET FORMAT])
422 AT_DATA([set.pspp], [dnl
430 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl