X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=tests%2Flanguage%2Fdata-io%2Fget-data-spreadsheet.at;h=54486f02f08f842ba046538a22d0fb903d8c3fd5;hb=b2368722d2281703dd72de978e2fb7ad9caea7e5;hp=cc03ade98325186414404dd83ad6831b63b4b809;hpb=691a034d7f2139076fa012739dffd40ef5db4a9b;p=pspp
diff --git a/tests/language/data-io/get-data-spreadsheet.at b/tests/language/data-io/get-data-spreadsheet.at
index cc03ade983..54486f02f0 100644
--- a/tests/language/data-io/get-data-spreadsheet.at
+++ b/tests/language/data-io/get-data-spreadsheet.at
@@ -1,29 +1,28 @@
dnl PSPP - a program for statistical analysis.
dnl Copyright (C) 2017 Free Software Foundation, Inc.
-dnl
+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
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
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see .
-dnl
+dnl
m4_define([SPREADSHEET_TEST_PREP],[dnl
+ AT_KEYWORDS([spreadsheet])
m4_if($1,[GNM],[dnl
AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric])dnl
m4_define([testsheet],[Book1.gnumeric])dnl
- AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes])dnl
]) dnl
m4_if($1,[ODS],[dnl
AT_CHECK([cp $top_srcdir/tests/language/data-io/test.ods test.ods])dnl
m4_define([testsheet],[test.ods])dnl
- AT_SKIP_IF([test n$ODF_READ_SUPPORT != nyes])dnl
])dnl
])
@@ -38,18 +37,19 @@ LIST.
])
AT_CHECK([pspp -o pspp.csv get-data.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Description,Position
-VAR001,Format: F8.2,1
-VAR002,Format: A8,2
-VAR003,Format: F8.2,3
+Table: Variables
+Name,Position,Print Format,Write Format
+VAR001,1,F8.2,F8.2
+VAR002,2,A8,A8
+VAR003,3,F8.2,F8.2
Table: Data List
VAR001,VAR002,VAR003
-.00,fred ,20.00
-1.00,11 ,21.00
-2.00,twelve ,22.00
-3.00,13 ,23.00
-4.00,14 ,24.00
+.00,fred,20.00
+1.00,11,21.00
+2.00,twelve,22.00
+3.00,13,23.00
+4.00,14,24.00
])
AT_CLEANUP
@@ -62,18 +62,19 @@ LIST.
])
AT_CHECK([pspp -o pspp.csv get-data.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Description,Position
-V1,Format: F8.2,1
-V2,Format: A8,2
-VAR001,Format: F8.2,3
+Table: Variables
+Name,Position,Print Format,Write Format
+V1,1,F8.2,F8.2
+V2,2,A8,A8
+VAR001,3,F8.2,F8.2
Table: Data List
V1,V2,VAR001
-.00,fred ,20.00
-1.00,11 ,21.00
-2.00,twelve ,22.00
-3.00,13 ,23.00
-4.00,14 ,24.00
+.00,fred,20.00
+1.00,11,21.00
+2.00,twelve,22.00
+3.00,13,23.00
+4.00,14,24.00
])
AT_CLEANUP
@@ -85,19 +86,20 @@ DISPLAY VARIABLES.
LIST.
])
AT_CHECK([pspp -O format=csv get-data.sps], [0], [dnl
-Variable,Description,Position
-name,Format: A8,1
-id,Format: F8.2,2
-height,Format: F8.2,3
+Table: Variables
+Name,Position,Print Format,Write Format
+name,1,A8,A8
+id,2,F8.2,F8.2
+height,3,F8.2,F8.2
warning: Cannot convert the value in the spreadsheet cell C4 to format (F8.2): Field contents are not numeric.
Table: Data List
name,id,height
-fred ,.00,23.40
-bert ,1.00,.56
-charlie ,2.00,. @&t@
-dick ,3.00,-34.09
+fred,.00,23.40
+bert,1.00,.56
+charlie,2.00,. @&t@
+dick,3.00,-34.09
])
AT_CLEANUP
@@ -111,11 +113,12 @@ LIST.
])
AT_CHECK([pspp -o pspp.csv get-data.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
-Variable,Description,Position
-vone,Format: F8.2,1
-vtwo,Format: F8.2,2
-vthree,Format: A8,3
-v4,Format: F8.2,4
+Table: Variables
+Name,Position,Print Format,Write Format
+vone,1,F8.2,F8.2
+vtwo,2,F8.2,F8.2
+vthree,3,A8,A8
+v4,4,F8.2,F8.2
Table: Data List
vone,vtwo,vthree,v4
@@ -170,7 +173,7 @@ CHECK_SPREADSHEET_READER([GNM])
dnl Check for a bug where gnumeric files were interpreted incorrectly
AT_SETUP([GET DATA /TYPE=GNM sheet index bug])
-AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes])
+AT_KEYWORDS([spreadsheet])
AT_DATA([minimal3.gnumeric],[dnl
@@ -295,7 +298,7 @@ AT_DATA([minimal3.gnumeric],[dnl
])
AT_DATA([gnum.sps], [dnl
-GET DATA
+GET DATA
/TYPE=GNM
/FILE='minimal3.gnumeric'
/SHEET=index 3
@@ -308,9 +311,9 @@ LIST.
AT_CHECK([pspp -O format=csv gnum.sps], [0], [dnl
Table: Data List
VAR001,VAR002,VAR003
-3 ,4.00,5.00
-6 ,7.00,8.00
-9 ,10.00,11.00
+3,4.00,5.00
+6,7.00,8.00
+9,10.00,11.00
])
@@ -319,11 +322,11 @@ AT_CLEANUP
dnl Check for a bug where certain gnumeric files failed an assertion
AT_SETUP([GET DATA /TYPE=GNM assert-fail])
-AT_SKIP_IF([test n$GNM_READ_SUPPORT != nyes])
+AT_KEYWORDS([spreadsheet])
AT_DATA([read.sps],[dnl
-GET DATA
+GET DATA
/TYPE=GNM
- /FILE='crash.gnumeric'
+ /FILE='crash.gnumeric'
.
list.
])
@@ -376,9 +379,9 @@ CHECK_SPREADSHEET_READER([ODS])
AT_SETUP([GET DATA /TYPE=ODS crash])
-AT_SKIP_IF([test n$ODF_READ_SUPPORT != nyes])
+AT_KEYWORDS([spreadsheet])
+
-
AT_CHECK([cp $top_srcdir/tests/language/data-io/newone.ods this.ods])dnl
AT_DATA([crash.sps],[dnl
@@ -390,3 +393,37 @@ AT_CHECK([pspp -O format=csv crash.sps], [0], [ignore])
AT_CLEANUP
+
+AT_SETUP([GET DATA /TYPE=ODS readnames])
+AT_KEYWORDS([spreadsheet])
+
+dnl Check for a bug where in the ODS reader /READNAMES incorrectly
+dnl dealt with repeated names.
+AT_CHECK([cp $top_srcdir/tests/language/data-io/readnames.ods this.ods])dnl
+
+AT_DATA([readnames.sps],[dnl
+GET DATA /TYPE=ODS /FILE='this.ods' /CELLRANGE=RANGE 'A1:H8' /READNAMES=ON
+DISPLAY DICTIONARY.
+LIST.
+])
+
+
+AT_CHECK([pspp -O format=csv readnames.sps], [0], [dnl
+Table: Variables
+Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+freda,1,Scale,Input,8,Right,F8.2,F8.2
+fred,2,Scale,Input,8,Right,F8.2,F8.2
+fred_A,3,Scale,Input,8,Right,F8.2,F8.2
+fred_B,4,Scale,Input,8,Right,F8.2,F8.2
+fred_C,5,Scale,Input,8,Right,F8.2,F8.2
+fred_D,6,Scale,Input,8,Right,F8.2,F8.2
+fred_E,7,Scale,Input,8,Right,F8.2,F8.2
+
+Table: Data List
+freda,fred,fred_A,fred_B,fred_C,fred_D,fred_E
+1.00,2.00,3.00,4.00,5.00,6.00,7.00
+8.00,9.00,10.00,11.00,12.00,13.00,14.00
+])
+
+AT_CLEANUP
+