3 AT_SETUP([FORMATS positive tests])
4 AT_DATA([formats.sps], [dnl
5 DATA LIST LIST /a b c * x (A1) y (A2) z (A3).
7 FORMATS /a (COMMA10) b (N4).
9 FORMATS c (E8.1) x (A1) /y (AHEX4) z (A3).
12 AT_CHECK([pspp -o pspp.csv formats.sps])
13 AT_CHECK([grep -E -v 'Measure|Display' pspp.csv], [0], [dnl
14 Table: Reading free-form data from INLINE.
23 Variable,Description,,Position
31 Variable,Description,,Position
32 a,Format: COMMA10.0,,1
39 Variable,Description,,Position
40 a,Format: COMMA10.0,,1
49 AT_SETUP([FORMATS negative tests])
50 AT_DATA([formats.sps], [dnl
51 DATA LIST LIST /a b c * x (A1) y (A2) z (A3).
58 AT_CHECK([pspp -O format=csv formats.sps], [1], [dnl
59 Table: Reading free-form data from INLINE.
68 "formats.sps:2: error: FORMATS: Output format E6.1 specifies 1 decimal place, but the given width does not allow for any decimals."
70 formats.sps:3: error: FORMATS: a and y are not the same type. All variables in this variable list must be of the same type. y will be omitted from the list.
72 formats.sps:4: error: FORMATS: String variable with width 1 is not compatible with format A2.
74 formats.sps:5: error: FORMATS: String variable with width 2 is not compatible with format AHEX2.
76 formats.sps:6: error: FORMATS: x and y are string variables with different widths. All variables in this variable list must have the same width. y will be omitted from the list.
78 formats.sps:6: error: FORMATS: String variable with width 1 is not compatible with format A2.