Add SET TVARS option. Closes bug #31566
[pspp] / tests / language / dictionary / variable-display.at
1 AT_BANNER([variable display attributes])
2
3 AT_SETUP([variable display attribute commands])
4 AT_DATA([var-display.sps], [dnl
5 DATA LIST FREE /x y z.
6 VARIABLE ALIGNMENT x (LEFT)/y (RIGHT)/z (CENTER).
7 VARIABLE WIDTH x (10)/y (12)/z (14).
8 VARIABLE LEVEL x (SCALE)/y (ORDINAL)/z (NOMINAL).
9 DISPLAY DICTIONARY.
10 ])
11 AT_CHECK([pspp -o pspp.csv var-display.sps])
12 AT_CHECK([cat pspp.csv], [0], [dnl
13 Variable,Description,,Position
14 x,Format: F8.2,,1
15 ,Measure: Scale,,
16 ,Display Alignment: Left,,
17 ,Display Width: 10,,
18 y,Format: F8.2,,2
19 ,Measure: Ordinal,,
20 ,Display Alignment: Right,,
21 ,Display Width: 12,,
22 z,Format: F8.2,,3
23 ,Measure: Nominal,,
24 ,Display Alignment: Center,,
25 ,Display Width: 14,,
26 ])
27 AT_CLEANUP
28
29
30 AT_BANNER([VARIABLE LABELS])
31
32 AT_SETUP([variable labels])
33
34 dnl The following test is to make sure the TVARS command works and that
35 dnl variables are displayed accordingly.
36 AT_DATA([var-labels.sps], [dnl
37 DATA LIST LIST NOTABLE /x * y *.
38 BEGIN DATA.
39 1 100
40 2 200
41 3 300
42 4 400
43 END DATA.
44
45 * While no labels have been set, the TVARS is irrelevant.
46 SET TVARS=NAMES.
47 DESCRIPTIVES ALL.
48
49 SET TVARS=LABELS.
50 DESCRIPTIVES ALL.
51
52 SET TVARS=BOTH.
53 DESCRIPTIVES ALL.
54
55 VARIABLE LABEL x 'foo' y 'bar'.
56
57 * Now, the TVARS setting should have effect
58
59 SET TVARS=NAMES.
60 DESCRIPTIVES ALL.
61
62 SET TVARS=LABELS.
63 DESCRIPTIVES ALL.
64
65 SET TVARS=BOTH.
66 DESCRIPTIVES ALL.
67 ])
68
69 AT_CHECK([pspp -O format=csv var-labels.sps], [0],[dnl
70 Table: Valid cases = 4; cases with missing value(s) = 0.
71 Variable,N,Mean,Std Dev,Minimum,Maximum
72 x,4,2.50,1.29,1.00,4.00
73 y,4,250.00,129.10,100.00,400.00
74
75 Table: Valid cases = 4; cases with missing value(s) = 0.
76 Variable,N,Mean,Std Dev,Minimum,Maximum
77 x,4,2.50,1.29,1.00,4.00
78 y,4,250.00,129.10,100.00,400.00
79
80 Table: Valid cases = 4; cases with missing value(s) = 0.
81 Variable,N,Mean,Std Dev,Minimum,Maximum
82 x,4,2.50,1.29,1.00,4.00
83 y,4,250.00,129.10,100.00,400.00
84
85 Table: Valid cases = 4; cases with missing value(s) = 0.
86 Variable,N,Mean,Std Dev,Minimum,Maximum
87 x,4,2.50,1.29,1.00,4.00
88 y,4,250.00,129.10,100.00,400.00
89
90 Table: Valid cases = 4; cases with missing value(s) = 0.
91 Variable,N,Mean,Std Dev,Minimum,Maximum
92 foo,4,2.50,1.29,1.00,4.00
93 bar,4,250.00,129.10,100.00,400.00
94
95 Table: Valid cases = 4; cases with missing value(s) = 0.
96 Variable,N,Mean,Std Dev,Minimum,Maximum
97 foo (x),4,2.50,1.29,1.00,4.00
98 bar (y),4,250.00,129.10,100.00,400.00
99 ])
100
101 AT_CLEANUP