X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fdata-io%2Fdata-list.at;h=8637ff7c6a348c4f4afa318109ee8e23e314c062;hb=e333a444bba7a84682b26a68c0894a8ca4f353a4;hp=b70e3904f516880dc8e97d33bf21c2a91982d0bb;hpb=254183e467ae32e6581fafc798a057f55e34773e;p=pspp diff --git a/tests/language/data-io/data-list.at b/tests/language/data-io/data-list.at index b70e3904f5..8637ff7c6a 100644 --- a/tests/language/data-io/data-list.at +++ b/tests/language/data-io/data-list.at @@ -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 . +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 non-negative. + +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 non-negative. + +data-list.sps:3: error: Stopping syntax file processing here to avoid a cascade of dependent command failures. +]) + +AT_CLEANUP +