3 AT_SETUP([DO REPEAT -- simple])
4 AT_DATA([do-repeat.sps], [dnl
7 DO REPEAT xval = 1 2 3 / yval = 'a' 'b' 'c' / var = a b c.
17 AT_CHECK([pspp -o pspp.csv do-repeat.sps])
18 AT_CHECK([cat pspp.csv], [0], [dnl
27 AT_SETUP([DO REPEAT -- containing BEGIN DATA])
28 AT_DATA([do-repeat.sps], [dnl
29 DO REPEAT offset = 1 2 3.
30 DATA LIST NOTABLE /x 1-2.
36 COMPUTE x = x + offset.
40 AT_CHECK([pspp -o pspp.csv do-repeat.sps])
41 AT_CHECK([cat pspp.csv], [0], [dnl
62 AT_SETUP([DO REPEAT -- dummy vars not expanded in include files])
63 AT_DATA([include.sps], [dnl
64 COMPUTE y = y + x + 10.
66 AT_DATA([do-repeat.sps], [dnl
75 INCLUDE 'include.sps'.
80 AT_CHECK([pspp -o pspp.csv do-repeat.sps], [0], [dnl
81 do-repeat.sps:8: warning: DO REPEAT: Dummy variable name `x' hides dictionary variable `x'.
83 AT_CHECK([cat pspp.csv], [0], [dnl
84 do-repeat.sps:8: warning: DO REPEAT: Dummy variable name `x' hides dictionary variable `x'.
92 AT_SETUP([DO REPEAT -- nested])
93 AT_DATA([do-repeat.sps], [dnl
94 DATA LIST NOTABLE /a 1.
99 DO REPEAT h = h0 TO h3 / x = 0 TO 3 / y = 8, 7.5, 6, 5.
105 DO REPEAT i = 1 TO 2.
106 DO REPEAT j = 3 TO 5.
108 COMPUTE #idx = #idx + 1.
109 COMPUTE v(#idx) = #x.
115 AT_CHECK([pspp -o pspp.csv do-repeat.sps])
116 AT_CHECK([cat pspp.csv], [0], [dnl
118 a,h0,h1,h2,h3,v1,v2,v3,v4,v5,v6
119 0,8.00,8.50,8.00,8.00,4.00,5.00,6.00,5.00,6.00,7.00
123 dnl This program tests for a bug that crashed PSPP given an empty DO
124 dnl REPEAT...END REPEAT block. See bug #18407.
125 AT_SETUP([DO REPEAT -- empty])
126 AT_DATA([do-repeat.sps], [dnl
127 DATA LIST NOTABLE /a 1.
135 AT_CHECK([pspp -o pspp.csv do-repeat.sps])
136 AT_CHECK([cat pspp.csv], [0], [dnl
140 dnl This program tests for a bug that crashed PSPP when END REPEAT
141 dnl was missing. See bug #31016.
142 AT_SETUP([DO REPEAT -- missing END REPEAT])
143 AT_DATA([do-repeat.sps], [dnl
144 DATA LIST NOTABLE /x 1.
145 DO REPEAT y = 1 TO 10.
147 AT_CHECK([pspp -O format=csv do-repeat.sps], [1], [dnl
148 error: DO REPEAT: Syntax error at end of input: expecting `END'.