AT_BANNER([VARIABLE ATTRIBUTES and DATAFILE ATTRIBUTES])

AT_SETUP([VARIABLE ATTRIBUTES and DATAFILE ATTRIBUTES])
AT_DATA([save-attrs.pspp],
  [[DATA LIST FREE/a b c.
BEGIN DATA.
1 2 3
END DATA.

DATAFILE ATTRIBUTE
	ATTRIBUTE=key('value')
                  array('array element 1')
                  Array[2]('array element 2').
VARIABLE ATTRIBUTE
        VARIABLES=a b
        ATTRIBUTE=ValidationRule[2]("a + b > 2")
                  ValidationRule[1]('a * b > 3')
       /VARIABLES=c
        ATTRIBUTE=QuestionWording('X or Y?').
DISPLAY ATTRIBUTES.

SAVE OUTFILE='attributes.sav'.
]])
AT_DATA([get-attrs.pspp],
  [[GET FILE='attributes.sav'.

DATAFILE ATTRIBUTE
         DELETE=Array[1] Array[2].
VARIABLE ATTRIBUTE
         VARIABLES=a
         DELETE=ValidationRule
        /VARIABLE=b
         DELETE=validationrule[2].

DISPLAY ATTRIBUTES.
]])
AT_CHECK([pspp -O format=csv save-attrs.pspp], [0], 
  [[Variable,Description,
a,Custom attributes:,
,ValidationRule[1],a * b > 3
,ValidationRule[2],a + b > 2
b,Custom attributes:,
,ValidationRule[1],a * b > 3
,ValidationRule[2],a + b > 2
c,Custom attributes:,
,QuestionWording,X or Y?

Table: Custom data file attributes.
Attribute,Value
array[1],array element 1
array[2],array element 2
key,value
]])
AT_CHECK([pspp -O format=csv get-attrs.pspp], [0], [dnl
Variable,Description,
b,Custom attributes:,
,ValidationRule,a * b > 3
c,Custom attributes:,
,QuestionWording,X or Y?

Table: Custom data file attributes.
Attribute,Value
array,array element 2
key,value
])
AT_CLEANUP
