SET MXWARNS = 0 to be interpreted as unlimited.
[pspp] / tests / language / utilities / set.at
1 AT_BANNER([SET])
2
3 # This crashed older versions of PSPP (bug #30682).
4 AT_SETUP([SET FORMAT to invalid output format])
5 AT_DATA([set.pspp], [dnl
6 DATA LIST LIST NOTABLE /x.
7 BEGIN DATA.
8 1
9 2
10 3
11 END DATA.
12 SET FORMAT F41.
13 DESCRIPTIVES /x.
14 ])
15 AT_CHECK([pspp -O format=csv set.pspp], [1], [dnl
16 "set.pspp:7: error: SET: Output format F41.0 specifies width 41, but F requires a width between 1 and 40."
17
18 Table: Valid cases = 3; cases with missing value(s) = 0.
19 Variable,N,Mean,Std Dev,Minimum,Maximum
20 x,3,2.00,1.00,1.00,3.00
21 ])
22 AT_CLEANUP
23
24
25
26 AT_SETUP([SET MXWARNS])
27 dnl Make sure that syntax processing stops and that
28 dnl a warning is issued when the MXWARNS figure is
29 dnl exceeded.
30 AT_DATA([set.pspp], [dnl
31 set mxwarns=2.
32 data list notable list /x (f8.2) y (f8.2).
33 begin data
34 1 2
35 3 r
36 5 x
37 q 8
38 9 9
39 3 x
40 w w
41 end data.
42
43 comment The following line should not be executed.
44 list.
45 ])
46
47 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
48 "set.pspp:5: warning: (column 3, F field) Field contents are not numeric."
49
50 "set.pspp:6: warning: (column 3, F field) Field contents are not numeric."
51
52 "set.pspp:7: warning: (column 1, F field) Field contents are not numeric."
53
54 note: Warnings (3) exceed limit (2).  Syntax processing will be halted.
55 ])
56
57 AT_CLEANUP
58
59
60
61
62 AT_SETUP([SET MXWARNS special case zero])
63 dnl Make sure that MXWARNS interprets zero as infinity.
64 AT_DATA([mxwarns.pspp], [dnl
65 set mxwarns=0.
66 data list notable list /x (f8.2) y (f8.2) z *.
67 begin data
68 1 2 3
69 3 r 3
70 5 x 3
71 q 8 4
72 9 9 4
73 3 x 4
74 w w 4
75 end data.
76
77 list.
78 ])
79
80 AT_CHECK([pspp -O format=csv mxwarns.pspp], [0],
81 [warning: MXWARNS set to zero.  No further warnings will be given even when potentially problematic situations are encountered.
82
83 Table: Data List
84 x,y,z
85 1.00,2.00,3.00
86 3.00,.  ,3.00
87 5.00,.  ,3.00
88 .  ,8.00,4.00
89 9.00,9.00,4.00
90 3.00,.  ,4.00
91 .  ,.  ,4.00
92 ])
93
94 AT_CLEANUP