Enable the show value labels feature
[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 dnl This scenario was observed to erroneously free things twice
26 AT_SETUP([SET crash on invalid cc])
27 AT_DATA([set.pspp], [dnl
28 SET CCA='xxxx'.SHGW CCA.
29 ])
30
31 AT_CHECK([pspp -O format=csv set.pspp], [1], [ignore])
32 AT_CLEANUP
33
34
35
36 AT_SETUP([SET MXWARNS])
37 dnl Make sure that syntax processing stops and that
38 dnl a warning is issued when the MXWARNS figure is
39 dnl exceeded.
40 AT_DATA([set.pspp], [dnl
41 set mxwarns=2.
42 data list notable list /x (f8.2) y (f8.2).
43 begin data
44 1 2
45 3 r
46 5 x
47 q 8
48 9 9
49 3 x
50 w w
51 end data.
52
53 comment The following line should not be executed.
54 list.
55 ])
56
57 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
58 set.pspp:5.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
59
60 set.pspp:6.3: warning: Data for variable y is not valid as format F: Field contents are not numeric.
61
62 set.pspp:7.1: warning: Data for variable x is not valid as format F: Field contents are not numeric.
63
64 note: Warnings (3) exceed limit (2).  Syntax processing will be halted.
65 ])
66
67 AT_CLEANUP
68
69
70
71
72 AT_SETUP([SET MXWARNS special case zero])
73 dnl Make sure that MXWARNS interprets zero as infinity.
74 AT_DATA([mxwarns.pspp], [dnl
75 set mxwarns=0.
76 data list notable list /x (f8.2) y (f8.2) z *.
77 begin data
78 1 2 3
79 3 r 3
80 5 x 3
81 q 8 4
82 9 9 4
83 3 x 4
84 w w 4
85 end data.
86
87 list.
88 ])
89
90 AT_CHECK([pspp -O format=csv mxwarns.pspp], [0],
91 [warning: MXWARNS set to zero.  No further warnings will be given even when potentially problematic situations are encountered.
92
93 Table: Data List
94 x,y,z
95 1.00,2.00,3.00
96 3.00,.  ,3.00
97 5.00,.  ,3.00
98 .  ,8.00,4.00
99 9.00,9.00,4.00
100 3.00,.  ,4.00
101 .  ,.  ,4.00
102 ])
103
104 AT_CLEANUP
105
106 \f
107
108 AT_BANNER([PRESERVE and RESTORE])
109
110 AT_SETUP([PRESERVE of SET FORMAT])
111 AT_DATA([set.pspp], [dnl
112 SHOW FORMAT.
113 PRESERVE.
114 SET FORMAT F10.0.
115 SHOW FORMAT
116 RESTORE.
117 SHOW FORMAT.
118 ])
119 AT_CHECK([pspp -O format=csv set.pspp], [0], [dnl
120 set.pspp:1: note: SHOW: FORMAT is F8.2.
121
122 set.pspp:5: note: SHOW: FORMAT is F10.0.
123
124 set.pspp:6: note: SHOW: FORMAT is F8.2.
125 ])
126 AT_CLEANUP