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