From 519834fd74bf78f31fdc06870dc742cd7e033cb4 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 27 Sep 2010 21:55:17 -0700 Subject: [PATCH] tests: Break get-data.at up into get-data-gnm.at and get-data-txt.at --- tests/automake.mk | 3 +- tests/language/data-io/get-data-gnm.at | 162 +++++++++++++++++ .../data-io/{get-data.at => get-data-txt.at} | 164 +----------------- 3 files changed, 165 insertions(+), 164 deletions(-) create mode 100644 tests/language/data-io/get-data-gnm.at rename tests/language/data-io/{get-data.at => get-data-txt.at} (66%) diff --git a/tests/automake.mk b/tests/automake.mk index 82b223dc..0f31c14d 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -379,7 +379,8 @@ TESTSUITE_AT = \ tests/language/data-io/data-list.at \ tests/language/data-io/data-reader.at \ tests/language/data-io/file-handle.at \ - tests/language/data-io/get-data.at \ + tests/language/data-io/get-data-gnm.at \ + tests/language/data-io/get-data-txt.at \ tests/language/data-io/save.at \ tests/language/data-io/save-translate.at \ tests/language/dictionary/attributes.at \ diff --git a/tests/language/data-io/get-data-gnm.at b/tests/language/data-io/get-data-gnm.at new file mode 100644 index 00000000..92815dc0 --- /dev/null +++ b/tests/language/data-io/get-data-gnm.at @@ -0,0 +1,162 @@ +AT_BANNER([GET DATA /TYPE=GNM]) + +AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=off /SHEET=name 'This' /CELLRANGE=range 'g9:i13' . +DISPLAY VARIABLES. +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 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +VAR002,Format: A8,,2 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +VAR003,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +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 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE and READNAMES]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=name 'This' /CELLRANGE=range 'g8:i13' . +DISPLAY VARIABLES. +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 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +V2,Format: A8,,2 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +VAR001,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +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 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM without CELLRANGE]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=index 3. +DISPLAY VARIABLES. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Description,,Position +name,Format: A8,,1 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +id,Format: F8.2,,2 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +height,Format: F8.2,,3 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +name,id,height +fred ,.00,23.40 +bert ,1.00,.56 +charlie ,2.00,. @&t@ +dick ,3.00,-34.09 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with missing data]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet has no data in one of its variables +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=index 5. +DISPLAY VARIABLES. +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 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +vtwo,Format: F8.2,,2 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, +vthree,Format: A8,,3 +,Measure: Nominal,, +,Display Alignment: Left,, +,Display Width: 8,, +v4,Format: F8.2,,4 +,Measure: Scale,, +,Display Alignment: Right,, +,Display Width: 8,, + +Table: Data List +vone,vtwo,vthree,v4 +1.00,3.00,,5.00 +2.00,4.00,,6.00 +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with empty sheet]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet is empty +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'Empty'. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl +warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. +]) +AT_CLEANUP + +AT_SETUP([GET DATA /TYPE=GNM with nonexistent sheet]) +AT_SKIP_IF([test "$GNM_SUPPORT" = no]) +AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) +AT_DATA([get-data.sps], [dnl +* This sheet doesnt exist. +GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'foobarxx'. +]) +AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl +warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. +]) +AT_CLEANUP diff --git a/tests/language/data-io/get-data.at b/tests/language/data-io/get-data-txt.at similarity index 66% rename from tests/language/data-io/get-data.at rename to tests/language/data-io/get-data-txt.at index 3b4d8b73..b5525b71 100644 --- a/tests/language/data-io/get-data.at +++ b/tests/language/data-io/get-data-txt.at @@ -281,6 +281,7 @@ Molly ,2.0,Black,12.12.2006,25.00,"5"" ",Cat @&t@ Gilly ,. ,White,10.04.2007,10.00,"3"" ",Guinea Pig ]) AT_CLEANUP +dnl " (fixes Emacs highlighting) AT_SETUP([GET DATA /TYPE=TXT with IMPORTCASES]) AT_CHECK([$PERL > test.data <<'EOF' @@ -567,166 +568,3 @@ x 100 ]) AT_CLEANUP - -AT_BANNER([GET DATA /TYPE=GNM]) - -AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=off /SHEET=name 'This' /CELLRANGE=range 'g9:i13' . -DISPLAY VARIABLES. -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 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -VAR002,Format: A8,,2 -,Measure: Nominal,, -,Display Alignment: Left,, -,Display Width: 8,, -VAR003,Format: F8.2,,3 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, - -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 -]) -AT_CLEANUP - -AT_SETUP([GET DATA /TYPE=GNM with CELLRANGE and READNAMES]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=name 'This' /CELLRANGE=range 'g8:i13' . -DISPLAY VARIABLES. -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 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -V2,Format: A8,,2 -,Measure: Nominal,, -,Display Alignment: Left,, -,Display Width: 8,, -VAR001,Format: F8.2,,3 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, - -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 -]) -AT_CLEANUP - -AT_SETUP([GET DATA /TYPE=GNM without CELLRANGE]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=index 3. -DISPLAY VARIABLES. -LIST. -]) -AT_CHECK([pspp -o pspp.csv get-data.sps]) -AT_CHECK([cat pspp.csv], [0], [dnl -Variable,Description,,Position -name,Format: A8,,1 -,Measure: Nominal,, -,Display Alignment: Left,, -,Display Width: 8,, -id,Format: F8.2,,2 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -height,Format: F8.2,,3 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, - -Table: Data List -name,id,height -fred ,.00,23.40 -bert ,1.00,.56 -charlie ,2.00,. @&t@ -dick ,3.00,-34.09 -]) -AT_CLEANUP - -AT_SETUP([GET DATA /TYPE=GNM with missing data]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -* This sheet has no data in one of its variables -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /READNAMES=on /SHEET=index 5. -DISPLAY VARIABLES. -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 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -vtwo,Format: F8.2,,2 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, -vthree,Format: A8,,3 -,Measure: Nominal,, -,Display Alignment: Left,, -,Display Width: 8,, -v4,Format: F8.2,,4 -,Measure: Scale,, -,Display Alignment: Right,, -,Display Width: 8,, - -Table: Data List -vone,vtwo,vthree,v4 -1.00,3.00,,5.00 -2.00,4.00,,6.00 -]) -AT_CLEANUP - -AT_SETUP([GET DATA /TYPE=GNM with empty sheet]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -* This sheet is empty -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'Empty'. -]) -AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl -warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. -]) -AT_CLEANUP - -AT_SETUP([GET DATA /TYPE=GNM with nonexistent sheet]) -AT_SKIP_IF([test "$GNM_SUPPORT" = no]) -AT_CHECK([gzip -c $top_srcdir/tests/language/data-io/Book1.gnm.unzipped > Book1.gnumeric]) -AT_DATA([get-data.sps], [dnl -* This sheet doesnt exist. -GET DATA /TYPE=gnm /FILE='Book1.gnumeric' /SHEET=name 'foobarxx'. -]) -AT_CHECK([pspp -o pspp.csv get-data.sps], [0], [dnl -warning: Selected sheet or range of spreadsheet `Book1.gnumeric' is empty. -]) -AT_CLEANUP -- 2.30.2