lexer: Reimplement for better testability and internationalization.
[pspp-builds.git] / tests / language / stats / aggregate.at
index 3c10d3ad40fdc8a3e0a2daebd1e3e11a89c4a94c..1c3a7e17095ccd0613826486fa4958271c7153a4 100644 (file)
@@ -249,3 +249,41 @@ x,cn,y,sum,mean,median
 ])
 
 AT_CLEANUP
+
+
+AT_SETUP([AGGREGATE buggy duplicate variables])
+dnl Test for a bug which crashed when duplicated
+dnl variables were attempted.
+AT_DATA([dup-variables.sps],
+  [DATA LIST NOTABLE LIST /x * .
+begin data
+1
+1
+1
+1
+2
+2
+2
+3
+3
+3
+3
+3
+3
+end data.
+
+AGGREGATE OUTFILE=* MODE=ADDVARIABLES
+       /BREAK= x
+       /N_BREAK = N.
+
+AGGREGATE OUTFILE=* MODE=ADDVARIABLES
+       /BREAK= x
+       /N_BREAK = N.
+])
+
+AT_CHECK([pspp -O format=csv dup-variables.sps], [1],
+["dup-variables.sps:24: error: AGGREGATE: Variable name N_BREAK is not unique within the aggregate file dictionary, which contains the aggregate variables and the break variables."
+])
+
+
+AT_CLEANUP