Fix logic error in previous commit
[pspp] / tests / language / dictionary / attributes.at
1 AT_BANNER([VARIABLE ATTRIBUTES and DATAFILE ATTRIBUTES])
2
3 AT_SETUP([VARIABLE ATTRIBUTES and DATAFILE ATTRIBUTES])
4 AT_DATA([save-attrs.pspp],
5   [[DATA LIST FREE/a b c.
6 BEGIN DATA.
7 1 2 3
8 END DATA.
9
10 DATAFILE ATTRIBUTE
11         ATTRIBUTE=key('value')
12                   array('array element 1')
13                   Array[2]('array element 2').
14 VARIABLE ATTRIBUTE
15         VARIABLES=a b
16         ATTRIBUTE=ValidationRule[2]("a + b > 2")
17                   ValidationRule[1]('a * b > 3')
18        /VARIABLES=c
19         ATTRIBUTE=QuestionWording('X or Y?').
20 DISPLAY ATTRIBUTES.
21
22 SAVE OUTFILE='attributes.sav'.
23 ]])
24 AT_DATA([get-attrs.pspp],
25   [[GET FILE='attributes.sav'.
26
27 DATAFILE ATTRIBUTE
28          DELETE=Array[1] Array[2].
29 VARIABLE ATTRIBUTE
30          VARIABLES=a
31          DELETE=ValidationRule
32         /VARIABLE=b
33          DELETE=validationrule[2].
34
35 DISPLAY ATTRIBUTES.
36 ]])
37 AT_CHECK([pspp -O format=csv save-attrs.pspp], [0], 
38   [[Variable,Description
39 a,"Attribute,Value
40 ValidationRule[1],a * b > 3
41 ValidationRule[2],a + b > 2"
42 b,"Attribute,Value
43 ValidationRule[1],a * b > 3
44 ValidationRule[2],a + b > 2"
45 c,"Attribute,Value
46 QuestionWording,X or Y?"
47
48 Table: Custom data file attributes.
49 Attribute,Value
50 array[1],array element 1
51 array[2],array element 2
52 key,value
53 ]])
54 AT_CHECK([pspp -O format=csv get-attrs.pspp], [0], [dnl
55 Variable,Description
56 a,
57 b,"Attribute,Value
58 ValidationRule,a * b > 3"
59 c,"Attribute,Value
60 QuestionWording,X or Y?"
61
62 Table: Custom data file attributes.
63 Attribute,Value
64 array,array element 2
65 key,value
66 ])
67 AT_CLEANUP