output: Introduce pivot tables.
[pspp] / tests / language / data-io / data-list.at
index b70e3904f516880dc8e97d33bf21c2a91982d0bb..a1f599cba961b61afce6c29b7ffb4e3768932c23 100644 (file)
@@ -1,3 +1,19 @@
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl 
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([DATA LIST])
 
 AT_SETUP([DATA LIST LIST with empty fields])
@@ -333,8 +349,8 @@ data-list.sps:4: warning: Missing delimiter following quoted string.
 
 Table: Data List
 s
-y         @&t@
-z         @&t@
+y
+z
 ])
 AT_CLEANUP
 
@@ -350,3 +366,70 @@ d,DATETIME17.0
 f,F1.0
 ])
 AT_CLEANUP
+
+AT_SETUP([DATA LIST Decimal comma])
+AT_DATA([data-list.sps], [dnl
+SET DECIMAL=COMMA.
+
+DATA LIST NOTABLE LIST /A *.
+BEGIN DATA
+1
+2
+3
+3,5
+4
+4,5
+5
+6
+END DATA
+
+LIST /FORMAT=NUMBERED.
+])
+
+AT_CHECK([pspp -O format=csv data-list.sps], [0], [dnl
+Table: Data List
+Case Number,A
+1,"1,00"
+2,"2,00"
+3,"3,00"
+4,"3,50"
+5,"4,00"
+6,"4,50"
+7,"5,00"
+8,"6,00"
+])
+
+AT_CLEANUP
+
+
+AT_SETUP([DATA LIST - Negative SKIP])
+AT_DATA([data-list.sps], [dnl
+DATA LIST LIST FILE='f.in' NOTABLE SKIP=-1 /a b c d.
+
+EXECUTE.
+])
+
+AT_CHECK([pspp -O format=csv data-list.sps], [1], [dnl
+data-list.sps:1: error: DATA LIST: The SKIP value must be nonnegative.
+
+data-list.sps:3: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+])
+
+AT_CLEANUP
+
+
+AT_SETUP([DATA LIST - Negative RECORDS])
+AT_DATA([data-list.sps], [dnl
+DATA LIST LIST FILE='f.in' NOTABLE RECORDS=-1 /a b c d.
+
+EXECUTE.
+])
+
+AT_CHECK([pspp -O format=csv data-list.sps], [1], [dnl
+data-list.sps:1: error: DATA LIST: The RECORDS value must be nonnegative.
+
+data-list.sps:3: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+])
+
+AT_CLEANUP
+