data-in: Convert test for MONTH format to Autotest framework.
[pspp-builds.git] / tests / data / data-in.at
index 010baf115cba890e377411b569126804a966d4b4..e9a91bccafe65907589cb17004f1a401b6dc111e 100644 (file)
@@ -81,3 +81,283 @@ descriptives BIGNUM.
 ])
 AT_CHECK([pspp -o pspp.csv bignum.sps], [0], [ignore])
 AT_CLEANUP
+
+AT_SETUP([binary and hexadecimal input (IB, PIB, and PIBHEX formats)])
+AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > binhex-in.data])
+AT_CHECK([wc -c < binhex-in.data], [0], [131072
+])
+AT_DATA([binhex-in.sps], [dnl
+SET RIB=MSBFIRST.
+SET ERRORS=NONE.
+SET MXWARNS=10000000.
+SET MXERRS=10000000.
+FILE HANDLE data/NAME='binhex-in.data'/MODE=IMAGE/LRECL=2.
+DATA LIST FILE=data NOTABLE/ib 1-2 (IB) pib 1-2 (PIB) pibhex 1-2 (PIBHEX).
+COMPUTE x=$CASENUM - 1.
+PRINT OUTFILE='binhex-in.out'/x (PIBHEX4) ' ' ib pib pibhex.
+EXECUTE.
+])
+AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-in.expected.cmp.gz | \
+            $PERL -pe "printf ' %04X ', $.-1" > expout])
+AT_CHECK([pspp -O format=csv binhex-in.sps], [0])
+AT_CHECK([cat binhex-in.out], [0], [expout])
+AT_CLEANUP
+
+AT_SETUP([BCD input (P and PK formats)])
+AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > bcd-in.data])
+AT_CHECK([wc -c < bcd-in.data], [0], [131072
+])
+AT_DATA([bcd-in.sps], [dnl
+SET ERRORS=NONE.
+SET MXWARNS=10000000.
+SET MXERRS=10000000.
+FILE HANDLE data/NAME='bcd-in.data'/MODE=IMAGE/LRECL=2.
+DATA LIST FILE=data NOTABLE/p 1-2 (P) pk 1-2 (PK).
+COMPUTE x=$CASENUM - 1.
+PRINT OUTFILE='bcd-in.out'/x (PIBHEX4) ' ' P PK.
+EXECUTE.
+])
+AT_CHECK([gzip -cd < $top_srcdir/tests/data/bcd-in.expected.cmp.gz | \
+            $PERL -pe "printf ' %04X ', $.-1" > expout])
+AT_CHECK([pspp -O format=csv bcd-in.sps])
+AT_CHECK([cat bcd-in.out], [0], [expout])
+AT_CLEANUP
+
+AT_SETUP([legacy input (N and Z formats)])
+AT_CHECK([$PERL -e 'print pack "n", $_ foreach 0...65535' > legacy-in.data])
+AT_CHECK([wc -c < legacy-in.data], [0], [131072
+])
+AT_DATA([legacy-in.sps], [dnl
+SET ERRORS=NONE.
+SET MXWARNS=10000000.
+SET MXERRS=10000000.
+FILE HANDLE data/NAME='legacy-in.data'/MODE=IMAGE/LRECL=2.
+DATA LIST NOTABLE FILE=data/n 1-2 (N) z 1-2 (z).
+COMPUTE x=$CASENUM - 1.
+PRINT OUTFILE='legacy-in.out'/x (PIBHEX4) ' ' N Z.
+EXECUTE.
+])
+AT_CHECK([gzip -cd < $top_srcdir/tests/data/legacy-in.expected.cmp.gz | \
+            $PERL -pe "printf ' %04X ', $.-1" > expout])
+AT_CHECK([pspp -O format=csv legacy-in.sps])
+AT_CHECK([cat legacy-in.out], [0], [expout])
+AT_CLEANUP
+
+AT_SETUP([WKDAY input format])
+AT_DATA([wkday.sps], [dnl
+DATA LIST NOTABLE /wkday2 1-2 (wkday)
+                  wkday3 1-3 (wkday)
+                  wkday4 1-4 (wkday)
+                  wkday5 1-5 (wkday)
+                  wkday6 1-6 (wkday)
+                  wkday7 1-7 (wkday)
+                  wkday8 1-8 (wkday)
+                  wkday9 1-9 (wkday)
+                  wkday10 1-10 (wkday).
+BEGIN DATA.
+
+.
+monady
+tuseday
+WEDENSDAY
+Thurdsay
+fRidya
+SAturady
+sudnay
+sturday
+END DATA.
+FORMATS ALL (WKDAY2).
+PRINT OUTFILE='wkday.out'/ALL.
+EXECUTE.
+])
+AT_CHECK([pspp -O format=csv wkday.sps], [0], [dnl
+wkday.sps:20.1-2: warning: Data for variable wkday2 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-3: warning: Data for variable wkday3 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-4: warning: Data for variable wkday4 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-5: warning: Data for variable wkday5 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-6: warning: Data for variable wkday6 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-7: warning: Data for variable wkday7 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-8: warning: Data for variable wkday8 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-9: warning: Data for variable wkday9 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+
+wkday.sps:20.1-10: warning: Data for variable wkday10 is not valid as format WKDAY: Unrecognized weekday name.  At least the first two letters of an English weekday name must be specified.
+])
+AT_CHECK([cat wkday.out], [0], [dnl
+  .  .  .  .  .  .  .  .  . @&t@
+  .  .  .  .  .  .  .  .  . @&t@
+ MO MO MO MO MO MO MO MO MO @&t@
+ TU TU TU TU TU TU TU TU TU @&t@
+ WE WE WE WE WE WE WE WE WE @&t@
+ TH TH TH TH TH TH TH TH TH @&t@
+ FR FR FR FR FR FR FR FR FR @&t@
+ SA SA SA SA SA SA SA SA SA @&t@
+ SU SU SU SU SU SU SU SU SU @&t@
+  .  .  .  .  .  .  .  .  . @&t@
+])
+AT_CLEANUP
+
+AT_SETUP([MONTH input format])
+AT_DATA([month.sps], [dnl
+DATA LIST NOTABLE /month3 1-3 (MONTH)
+                  month4 1-4 (MONTH)
+                  month5 1-5 (MONTH)
+                  month6 1-6 (MONTH)
+                  month7 1-7 (MONTH)
+                  month8 1-8 (MONTH)
+                  month9 1-9 (MONTH)
+                  month10 1-10 (MONTH).
+BEGIN DATA.
+
+.
+i
+ii
+iii
+iiii
+iv
+v
+vi
+vii
+viii
+ix
+viiii
+x
+xi
+xii
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+january
+JANAURY
+February
+fEbraury
+MArch
+marhc
+apRIL
+may
+june
+july
+august
+september
+october
+november
+decmeber
+december
+END DATA.
+FORMATS ALL (MONTH3).
+PRINT OUTFILE='month.out'/ALL.
+EXECUTE.
+])
+AT_CHECK([pspp -O format=csv month.sps], [0], [dnl
+month.sps:15.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:15.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:26.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+
+month.sps:39.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format.  Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names.
+])
+AT_CHECK([cat month.out], [0], [dnl
+   .   .   .   .   .   .   .   . @&t@
+   .   .   .   .   .   .   .   . @&t@
+ JAN JAN JAN JAN JAN JAN JAN JAN @&t@
+ FEB FEB FEB FEB FEB FEB FEB FEB @&t@
+ MAR MAR MAR MAR MAR MAR MAR MAR @&t@
+ MAR   .   .   .   .   .   .   . @&t@
+ APR APR APR APR APR APR APR APR @&t@
+ MAY MAY MAY MAY MAY MAY MAY MAY @&t@
+ JUN JUN JUN JUN JUN JUN JUN JUN @&t@
+ JUL JUL JUL JUL JUL JUL JUL JUL @&t@
+ JUL AUG AUG AUG AUG AUG AUG AUG @&t@
+ SEP SEP SEP SEP SEP SEP SEP SEP @&t@
+ JUL AUG AUG AUG AUG AUG AUG AUG @&t@
+ OCT OCT OCT OCT OCT OCT OCT OCT @&t@
+ NOV NOV NOV NOV NOV NOV NOV NOV @&t@
+ DEC DEC DEC DEC DEC DEC DEC DEC @&t@
+   .   .   .   .   .   .   .   . @&t@
+ JAN JAN JAN JAN JAN JAN JAN JAN @&t@
+ FEB FEB FEB FEB FEB FEB FEB FEB @&t@
+ MAR MAR MAR MAR MAR MAR MAR MAR @&t@
+ APR APR APR APR APR APR APR APR @&t@
+ MAY MAY MAY MAY MAY MAY MAY MAY @&t@
+ JUN JUN JUN JUN JUN JUN JUN JUN @&t@
+ JUL JUL JUL JUL JUL JUL JUL JUL @&t@
+ AUG AUG AUG AUG AUG AUG AUG AUG @&t@
+ SEP SEP SEP SEP SEP SEP SEP SEP @&t@
+ OCT OCT OCT OCT OCT OCT OCT OCT @&t@
+ NOV NOV NOV NOV NOV NOV NOV NOV @&t@
+ DEC DEC DEC DEC DEC DEC DEC DEC @&t@
+   .   .   .   .   .   .   .   . @&t@
+ JAN JAN JAN JAN JAN JAN JAN JAN @&t@
+ JAN JAN JAN JAN JAN JAN JAN JAN @&t@
+ FEB FEB FEB FEB FEB FEB FEB FEB @&t@
+ FEB FEB FEB FEB FEB FEB FEB FEB @&t@
+ MAR MAR MAR MAR MAR MAR MAR MAR @&t@
+ MAR MAR MAR MAR MAR MAR MAR MAR @&t@
+ APR APR APR APR APR APR APR APR @&t@
+ MAY MAY MAY MAY MAY MAY MAY MAY @&t@
+ JUN JUN JUN JUN JUN JUN JUN JUN @&t@
+ JUL JUL JUL JUL JUL JUL JUL JUL @&t@
+ AUG AUG AUG AUG AUG AUG AUG AUG @&t@
+ SEP SEP SEP SEP SEP SEP SEP SEP @&t@
+ OCT OCT OCT OCT OCT OCT OCT OCT @&t@
+ NOV NOV NOV NOV NOV NOV NOV NOV @&t@
+ DEC DEC DEC DEC DEC DEC DEC DEC @&t@
+ DEC DEC DEC DEC DEC DEC DEC DEC @&t@
+])
+AT_CLEANUP