From 018f395e7f37c988d812bdf408c2c84e55ed8678 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 13 Oct 2010 20:59:45 -0700 Subject: [PATCH] data-in: Convert tests for date formats to Autotest framework. --- tests/automake.mk | 1 - tests/data/data-in.at | 2269 ++++++++++++++++++++++++++++++++++++- tests/formats/date-in.sh | 2305 -------------------------------------- 3 files changed, 2268 insertions(+), 2307 deletions(-) delete mode 100755 tests/formats/date-in.sh diff --git a/tests/automake.mk b/tests/automake.mk index 031c39ab..fc58b3cb 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -10,7 +10,6 @@ TESTS_ENVIRONMENT += LC_ALL=C TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT) dist_TESTS = \ - tests/formats/date-in.sh \ tests/formats/num-out.sh \ tests/formats/time-in.sh \ tests/formats/360.sh diff --git a/tests/data/data-in.at b/tests/data/data-in.at index 654c70e3..56cc0948 100644 --- a/tests/data/data-in.at +++ b/tests/data/data-in.at @@ -1,7 +1,7 @@ AT_BANNER([data input (data-in)]) m4_divert_push([PREPARE_TESTS]) -data_in_prng () { +[data_in_prng () { cat > my-rand.pl <<'EOF' # This random number generator and the test for it below are drawn # from Park and Miller, "Random Number Generators: Good Ones are Hard @@ -31,6 +31,164 @@ our $seed; die $seed if $seed != 1043618065; EOF } +date_in () { + data_in_prng + cat > date-in.pl << 'EOF' +#! /usr/bin/perl + +use strict; +use warnings; + +do 'my-rand.pl'; + +my ($fmt_name, @templates) = @ARGV; + +my @dates = (#yyyy mm dd jjj HH MM SS + [1648, 6, 10, 162, 0, 0, 0], + [1680, 6, 30, 182, 4, 50, 38], + [1716, 7, 24, 206, 12, 31, 35], + [1768, 6, 19, 171, 12, 47, 53], + [1819, 8, 2, 214, 1, 26, 0], + [1839, 3, 27, 86, 20, 58, 11], + [1903, 4, 19, 109, 7, 36, 5], + [1929, 8, 25, 237, 15, 43, 49], + [1941, 9, 29, 272, 4, 25, 9], + [1943, 4, 19, 109, 6, 49, 27], + [1943, 10, 7, 280, 2, 57, 52], + [1992, 3, 17, 77, 16, 45, 44], + [1996, 2, 25, 56, 21, 30, 57], + [1941, 9, 29, 272, 4, 25, 9], + [1943, 4, 19, 109, 6, 49, 27], + [1943, 10, 7, 280, 2, 57, 52], + [1992, 3, 17, 77, 16, 45, 44], + [1996, 2, 25, 56, 21, 30, 57], + [2038, 11, 10, 314, 22, 30, 4], + [2094, 7, 18, 199, 1, 56, 51]); + +open (SYNTAX, '>', "$fmt_name.sps") or die "$fmt_name.sps: create: $!\n"; +print SYNTAX "SET EPOCH 1930.\n"; +print SYNTAX "DATA LIST NOTABLE FILE='$fmt_name.in'/$fmt_name 1-40 ($fmt_name).\n"; +print SYNTAX "PRINT OUTFILE='$fmt_name.out'/$fmt_name (F16.2).\n"; +print SYNTAX "EXECUTE.\n"; +close (SYNTAX); + +my ($fn) = "$fmt_name.in"; +open (DATA, '>', $fn) or die "$fn: create: $!\n"; +select DATA; +for my $template (@templates) { + for my $date (@dates) { + print_date_with_template ($date, $template) for 1...10; + } +} +close (DATA); + +sub print_date_with_template { + my ($date, $template) = @_; + my ($year, $month, $day, $julian, $hour, $minute, $second) = @$date; + my ($quarter) = int (($month - 1) / 3) + 1; + my ($week) = int (($julian - 1) / 7) + 1; + my (@year_types) = ('full'); + push (@year_types, '2digit') if $year >= 1930 && $year < 2030; + for my $c (split ('', $template)) { + if ($c eq 'd') { + printf (+pick ('%d', '%02d'), $day); + } elsif ($c eq 'm') { + my ($type) = pick ('arabic', 'roman', 'abbrev', 'full'); + if ($type eq 'arabic') { + printf (+pick ('%d', '%02d'), $month); + } elsif ($type eq 'roman') { + my ($mmm) = ('i', 'ii', 'iii', + 'iv', 'v', 'vi', + 'vii', 'viii', 'ix', + 'x', 'xi', 'xii')[$month - 1]; + print_rand_case ($mmm); + } elsif ($type eq 'abbrev') { + my ($mmm) = qw (jan feb mar apr may jun + jul aug sep oct nov dec)[$month - 1]; + print_rand_case ($mmm); + } elsif ($type eq 'full') { + my ($mmm) = qw (january february march + april may june + july august september + october november december)[$month - 1]; + print_rand_case ($mmm); + } else { + die; + } + } elsif ($c eq 'y') { + my ($type) = pick (@year_types); + if ($type eq '2digit') { + printf (+pick ('%d', '%02d'), $year % 100); + } elsif ($type eq 'full') { + print $year; + } else { + die; + } + } elsif ($c eq 'j') { + my ($type) = pick (@year_types); + if ($type eq '2digit') { + printf ("%02d%03d", $year % 100, $julian); + } elsif ($type eq 'full') { + printf ("%04d%03d", $year, $julian); + } else { + die; + } + } elsif ($c eq 'q') { + print $quarter; + } elsif ($c eq 'w') { + print $week; + } elsif ($c eq 'H') { + printf (+pick ('%d', '%02d'), $hour); + } elsif ($c eq 'M') { + printf (+pick ('%d', '%02d'), $minute); + } elsif ($c eq 'S') { + printf (+pick ('%d', '%02d'), $second); + } elsif ($c eq '-') { + print +pick (' ', '-', '.', ',', '/'); + } elsif ($c eq ':') { + print +pick (' ', ':'); + } elsif ($c eq ' ') { + print ' '; + } elsif ($c eq 'Q') { + maybe_print_space (); + print_rand_case ('q'); + maybe_print_space (); + } elsif ($c eq 'W') { + maybe_print_space (); + print_rand_case ('wk'); + maybe_print_space (); + } elsif ($c eq '+') { + print +pick ('', '-', '+'); + } else { + die; + } + } + print "\n"; +} + +sub print_rand_case { + my ($s) = @_; + my ($case) = pick (qw (uc lc tc)); + if ($case eq 'uc') { + print uc ($s); + } elsif ($case eq 'lc') { + print lc ($s); + } elsif ($case eq 'tc') { + print ucfirst ($s); + } else { + die; + } +} + +sub maybe_print_space { + print +pick ('', ' '); +} + +sub pick { + return $_[int (my_rand ($#_ + 1))]; +} +EOF +}] m4_divert_pop([PREPARE_TESTS]) AT_SETUP([numeric input formats]) @@ -236,6 +394,2115 @@ descriptives BIGNUM. AT_CHECK([pspp -o pspp.csv bignum.sps], [0], [ignore]) AT_CLEANUP +AT_SETUP([DATE input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl date d-m-y]) +AT_CHECK([test -s date.sps]) +AT_CHECK([test -s date.in]) +AT_CHECK([pspp -O format=csv date.sps]) +AT_CHECK([cat date.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 +]) +AT_CLEANUP + +AT_SETUP([ADATE input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl adate m-d-y]) +AT_CHECK([test -s adate.sps]) +AT_CHECK([test -s adate.in]) +AT_CHECK([pspp -O format=csv adate.sps]) +AT_CHECK([cat adate.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 +]) +AT_CLEANUP + +AT_SETUP([EDATE input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl edate d-m-y]) +AT_CHECK([test -s edate.sps]) +AT_CHECK([test -s edate.in]) +AT_CHECK([pspp -O format=csv edate.sps]) +AT_CHECK([cat edate.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 +]) +AT_CLEANUP + +AT_SETUP([JDATE input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl jdate j]) +AT_CHECK([test -s jdate.sps]) +AT_CHECK([test -s jdate.in]) +AT_CHECK([pspp -O format=csv jdate.sps]) +AT_CHECK([cat jdate.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 +]) +AT_CLEANUP + +AT_SETUP([SDATE input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl sdate y-m-d]) +AT_CHECK([test -s sdate.sps]) +AT_CHECK([test -s sdate.in]) +AT_CHECK([pspp -O format=csv sdate.sps]) +AT_CHECK([cat sdate.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 3083529600.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 4221590400.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 5859561600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 7472649600.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 8092742400.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10114329600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 10945929600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11327644800.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11376633600.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 11391408000.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 12920169600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 13044585600.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 14392339200.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 + 16149628800.00 +]) +AT_CLEANUP + +AT_SETUP([QYR input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl qyr qQy]) +AT_CHECK([test -s qyr.sps]) +AT_CHECK([test -s qyr.in]) +AT_CHECK([pspp -O format=csv qyr.sps]) +AT_CHECK([cat qyr.out], [0], [dnl + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 2065910400.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 3075753600.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 5852736000.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 7469884800.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 8085398400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 10941177600.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11319868800.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 12913603200.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 13039833600.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 14388883200.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 +]) +AT_CLEANUP + +AT_SETUP([MOYR input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl moyr m-y]) +AT_CHECK([test -s moyr.sps]) +AT_CHECK([test -s moyr.in]) +AT_CHECK([pspp -O format=csv moyr.sps]) +AT_CHECK([cat moyr.out], [0], [dnl + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 2071180800.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 3081024000.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 4219603200.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 5858006400.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 7472563200.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 8090496000.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10112774400.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 10943856000.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11325225600.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11375078400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 12918787200.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 13042512000.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 14391561600.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 + 16148160000.00 +]) +AT_CLEANUP + +AT_SETUP([WKYR input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl wkyr wWy]) +AT_CHECK([test -s wkyr.sps]) +AT_CHECK([test -s wkyr.in]) +AT_CHECK([pspp -O format=csv wkyr.sps]) +AT_CHECK([cat wkyr.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 3083011200.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 4221417600.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 5859388800.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 7472390400.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 8092656000.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10114070400.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 10945497600.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11327212800.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11376374400.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 11390889600.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 12919651200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 13044067200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 14391907200.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 + 16149456000.00 +]) +AT_CLEANUP + +AT_SETUP([DATETIME input format]) +AT_KEYWORDS([data-in]) +date_in +AT_CHECK([$PERL test-my-rand.pl]) +AT_CHECK([$PERL date-in.pl datetime "d-m-y +H:M" "d-m-y +H:M:S"]) +AT_CHECK([test -s datetime.sps]) +AT_CHECK([test -s datetime.in]) +AT_CHECK([pspp -O format=csv datetime.sps]) +AT_CHECK([cat datetime.out], [0], [dnl + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083512200.00 + 3083512200.00 + 3083547000.00 + 3083547000.00 + 3083547000.00 + 3083512200.00 + 3083547000.00 + 3083547000.00 + 3083512200.00 + 3083512200.00 + 4221545340.00 + 4221635460.00 + 4221545340.00 + 4221545340.00 + 4221635460.00 + 4221635460.00 + 4221545340.00 + 4221635460.00 + 4221545340.00 + 4221635460.00 + 5859607620.00 + 5859607620.00 + 5859515580.00 + 5859515580.00 + 5859607620.00 + 5859607620.00 + 5859607620.00 + 5859607620.00 + 5859515580.00 + 5859607620.00 + 7472644440.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472644440.00 + 7472654760.00 + 8092817880.00 + 8092666920.00 + 8092817880.00 + 8092666920.00 + 8092817880.00 + 8092817880.00 + 8092666920.00 + 8092817880.00 + 8092666920.00 + 8092817880.00 + 10114302240.00 + 10114356960.00 + 10114302240.00 + 10114302240.00 + 10114302240.00 + 10114356960.00 + 10114302240.00 + 10114302240.00 + 10114302240.00 + 10114356960.00 + 10945873020.00 + 10945986180.00 + 10945986180.00 + 10945986180.00 + 10945873020.00 + 10945986180.00 + 10945986180.00 + 10945873020.00 + 10945986180.00 + 10945873020.00 + 11327628900.00 + 11327660700.00 + 11327660700.00 + 11327660700.00 + 11327660700.00 + 11327628900.00 + 11327628900.00 + 11327660700.00 + 11327660700.00 + 11327660700.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376658140.00 + 11376658140.00 + 11391418620.00 + 11391418620.00 + 11391397380.00 + 11391397380.00 + 11391418620.00 + 11391418620.00 + 11391397380.00 + 11391418620.00 + 11391418620.00 + 11391418620.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920109300.00 + 12920229900.00 + 12920109300.00 + 12920229900.00 + 12920229900.00 + 13044508200.00 + 13044663000.00 + 13044508200.00 + 13044663000.00 + 13044508200.00 + 13044508200.00 + 13044663000.00 + 13044663000.00 + 13044663000.00 + 13044663000.00 + 11327660700.00 + 11327628900.00 + 11327628900.00 + 11327660700.00 + 11327628900.00 + 11327628900.00 + 11327628900.00 + 11327628900.00 + 11327628900.00 + 11327628900.00 + 11376609060.00 + 11376658140.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376609060.00 + 11376658140.00 + 11376658140.00 + 11391397380.00 + 11391397380.00 + 11391418620.00 + 11391397380.00 + 11391418620.00 + 11391418620.00 + 11391418620.00 + 11391418620.00 + 11391418620.00 + 11391397380.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 12920109300.00 + 12920229900.00 + 12920229900.00 + 12920229900.00 + 13044508200.00 + 13044663000.00 + 13044508200.00 + 13044508200.00 + 13044508200.00 + 13044663000.00 + 13044663000.00 + 13044663000.00 + 13044508200.00 + 13044508200.00 + 14392420200.00 + 14392258200.00 + 14392420200.00 + 14392420200.00 + 14392420200.00 + 14392420200.00 + 14392258200.00 + 14392420200.00 + 14392420200.00 + 14392420200.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149635760.00 + 16149621840.00 + 16149635760.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 2071958400.00 + 3083512162.00 + 3083512162.00 + 3083512162.00 + 3083547038.00 + 3083512162.00 + 3083512162.00 + 3083547038.00 + 3083512162.00 + 3083547038.00 + 3083547038.00 + 4221635495.00 + 4221545305.00 + 4221635495.00 + 4221635495.00 + 4221635495.00 + 4221545305.00 + 4221635495.00 + 4221635495.00 + 4221635495.00 + 4221635495.00 + 5859607673.00 + 5859515527.00 + 5859607673.00 + 5859607673.00 + 5859607673.00 + 5859607673.00 + 5859515527.00 + 5859607673.00 + 5859607673.00 + 5859607673.00 + 7472654760.00 + 7472644440.00 + 7472654760.00 + 7472654760.00 + 7472654760.00 + 7472644440.00 + 7472654760.00 + 7472654760.00 + 7472644440.00 + 7472654760.00 + 8092817891.00 + 8092817891.00 + 8092666909.00 + 8092817891.00 + 8092817891.00 + 8092817891.00 + 8092817891.00 + 8092817891.00 + 8092817891.00 + 8092817891.00 + 10114302235.00 + 10114302235.00 + 10114302235.00 + 10114356965.00 + 10114356965.00 + 10114356965.00 + 10114356965.00 + 10114356965.00 + 10114356965.00 + 10114302235.00 + 10945986229.00 + 10945986229.00 + 10945872971.00 + 10945872971.00 + 10945986229.00 + 10945986229.00 + 10945872971.00 + 10945986229.00 + 10945986229.00 + 10945986229.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11391397328.00 + 11391418672.00 + 11391418672.00 + 11391418672.00 + 11391397328.00 + 11391418672.00 + 11391397328.00 + 11391418672.00 + 11391418672.00 + 11391418672.00 + 12920229944.00 + 12920229944.00 + 12920109256.00 + 12920229944.00 + 12920229944.00 + 12920109256.00 + 12920109256.00 + 12920109256.00 + 12920229944.00 + 12920109256.00 + 13044663057.00 + 13044663057.00 + 13044663057.00 + 13044508143.00 + 13044663057.00 + 13044663057.00 + 13044663057.00 + 13044508143.00 + 13044663057.00 + 13044663057.00 + 11327628891.00 + 11327628891.00 + 11327660709.00 + 11327660709.00 + 11327660709.00 + 11327628891.00 + 11327628891.00 + 11327660709.00 + 11327660709.00 + 11327628891.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376658167.00 + 11376609033.00 + 11376658167.00 + 11376609033.00 + 11376658167.00 + 11376658167.00 + 11391418672.00 + 11391397328.00 + 11391418672.00 + 11391397328.00 + 11391397328.00 + 11391397328.00 + 11391397328.00 + 11391397328.00 + 11391397328.00 + 11391397328.00 + 12920229944.00 + 12920229944.00 + 12920229944.00 + 12920109256.00 + 12920229944.00 + 12920229944.00 + 12920229944.00 + 12920229944.00 + 12920229944.00 + 12920229944.00 + 13044663057.00 + 13044663057.00 + 13044663057.00 + 13044663057.00 + 13044508143.00 + 13044663057.00 + 13044508143.00 + 13044508143.00 + 13044663057.00 + 13044663057.00 + 14392258196.00 + 14392420204.00 + 14392420204.00 + 14392420204.00 + 14392258196.00 + 14392420204.00 + 14392420204.00 + 14392258196.00 + 14392420204.00 + 14392420204.00 + 16149635811.00 + 16149635811.00 + 16149635811.00 + 16149635811.00 + 16149635811.00 + 16149621789.00 + 16149621789.00 + 16149621789.00 + 16149635811.00 + 16149635811.00 +]) +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 diff --git a/tests/formats/date-in.sh b/tests/formats/date-in.sh deleted file mode 100755 index 859283df..00000000 --- a/tests/formats/date-in.sh +++ /dev/null @@ -1,2305 +0,0 @@ -#! /bin/sh - -TEMPDIR=/tmp/pspp-tst-$$ -mkdir -p $TEMPDIR -trap 'cd /; rm -rf $TEMPDIR' 0 - -# ensure that top_builddir are absolute -if [ -z "$top_builddir" ] ; then top_builddir=. ; fi -if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi -top_builddir=`cd $top_builddir; pwd` -PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT -: ${PERL:=perl} - -# ensure that top_srcdir is absolute -top_srcdir=`cd $top_srcdir; pwd` - -STAT_CONFIG_PATH=$top_srcdir/config -export STAT_CONFIG_PATH - -fail() -{ - echo $activity - echo FAILED - exit 1; -} - - -no_result() -{ - echo $activity - echo NO RESULT; - exit 2; -} - -pass() -{ - exit 0; -} - -cd $TEMPDIR - -activity="write PRNG fragment" -cat > my-rand.pl <<'EOF' -# This random number generator and the test for it below are drawn -# from Park and Miller, "Random Number Generators: Good Ones are Hard -# to Come By", Communications of the ACM 31:10 (October 1988). It is -# documented to function properly on systems with a 46-bit or longer -# real significand, which includes systems that have 64-bit IEEE reals -# (with 53-bit significand). The test should catch any systems for -# which this is not true, in any case. - -our ($seed) = 1; -sub my_rand { - my ($modulo) = @_; - my ($a) = 16807; - my ($m) = 2147483647; - my ($tmp) = $a * $seed; - $seed = $tmp - $m * int ($tmp / $m); - return $seed % $modulo; -} -EOF -if [ $? -ne 0 ] ; then no_result ; fi - -activity="write PRNG test program" -cat > test-my-rand.pl <<'EOF' -#! /usr/bin/perl -use strict; -use warnings; -do 'my-rand.pl'; -my_rand (1) foreach 1...10000; -our $seed; -die $seed if $seed != 1043618065; -EOF -if [ $? -ne 0 ] ; then no_result ; fi - -activity="test PRNG" -$PERL test-my-rand.pl -if [ $? -ne 0 ] ; then no_result ; fi - -activity="write program to generate PSPP syntax and data" -cat > date-in.pl <<'EOF' -#! /usr/bin/perl - -use strict; -use warnings; - -do 'my-rand.pl'; - -my @formats = (['date', 'd-m-y'], - ['adate', 'm-d-y'], - ['edate', 'd-m-y'], - ['jdate', 'j'], - ['sdate', 'y-m-d'], - ['qyr', 'qQy'], - ['moyr', 'm-y'], - ['wkyr', 'wWy'], - ['datetime', 'd-m-y +H:M', 'd-m-y +H:M:S']); - -my @dates = (#yyyy mm dd jjj HH MM SS - [1648, 6, 10, 162, 0, 0, 0], - [1680, 6, 30, 182, 4, 50, 38], - [1716, 7, 24, 206, 12, 31, 35], - [1768, 6, 19, 171, 12, 47, 53], - [1819, 8, 2, 214, 1, 26, 0], - [1839, 3, 27, 86, 20, 58, 11], - [1903, 4, 19, 109, 7, 36, 5], - [1929, 8, 25, 237, 15, 43, 49], - [1941, 9, 29, 272, 4, 25, 9], - [1943, 4, 19, 109, 6, 49, 27], - [1943, 10, 7, 280, 2, 57, 52], - [1992, 3, 17, 77, 16, 45, 44], - [1996, 2, 25, 56, 21, 30, 57], - [1941, 9, 29, 272, 4, 25, 9], - [1943, 4, 19, 109, 6, 49, 27], - [1943, 10, 7, 280, 2, 57, 52], - [1992, 3, 17, 77, 16, 45, 44], - [1996, 2, 25, 56, 21, 30, 57], - [2038, 11, 10, 314, 22, 30, 4], - [2094, 7, 18, 199, 1, 56, 51]); - -open (SYNTAX, '>', 'date-in.pspp') or die "date-in.pspp: create: $!\n"; -print SYNTAX "SET EPOCH 1930.\n"; -for my $format (@formats) { - my ($name) = @$format; - print SYNTAX "DATA LIST file='$name.data'/$name 1-40 ($name).\n"; - print SYNTAX "PRINT OUTFILE='$name.out'/$name (F16.2).\n"; - print SYNTAX "EXECUTE.\n"; -} -close (SYNTAX); - -for my $format (@formats) { - my ($fmt_name, @templates) = @$format; - my ($fn) = "$fmt_name.data"; - open (DATA, '>', $fn) or die "$fn: create: $!\n"; - select DATA; - for my $template (@templates) { - for my $date (@dates) { - print_date_with_template ($date, $template) for 1...10; - } - } - close (DATA); -} - -sub print_date_with_template { - my ($date, $template) = @_; - my ($year, $month, $day, $julian, $hour, $minute, $second) = @$date; - my ($quarter) = int (($month - 1) / 3) + 1; - my ($week) = int (($julian - 1) / 7) + 1; - my (@year_types) = ('full'); - push (@year_types, '2digit') if $year >= 1930 && $year < 2030; - for my $c (split ('', $template)) { - if ($c eq 'd') { - printf (+pick ('%d', '%02d'), $day); - } elsif ($c eq 'm') { - my ($type) = pick ('arabic', 'roman', 'abbrev', 'full'); - if ($type eq 'arabic') { - printf (+pick ('%d', '%02d'), $month); - } elsif ($type eq 'roman') { - my ($mmm) = ('i', 'ii', 'iii', - 'iv', 'v', 'vi', - 'vii', 'viii', 'ix', - 'x', 'xi', 'xii')[$month - 1]; - print_rand_case ($mmm); - } elsif ($type eq 'abbrev') { - my ($mmm) = qw (jan feb mar apr may jun - jul aug sep oct nov dec)[$month - 1]; - print_rand_case ($mmm); - } elsif ($type eq 'full') { - my ($mmm) = qw (january february march - april may june - july august september - october november december)[$month - 1]; - print_rand_case ($mmm); - } else { - die; - } - } elsif ($c eq 'y') { - my ($type) = pick (@year_types); - if ($type eq '2digit') { - printf (+pick ('%d', '%02d'), $year % 100); - } elsif ($type eq 'full') { - print $year; - } else { - die; - } - } elsif ($c eq 'j') { - my ($type) = pick (@year_types); - if ($type eq '2digit') { - printf ("%02d%03d", $year % 100, $julian); - } elsif ($type eq 'full') { - printf ("%04d%03d", $year, $julian); - } else { - die; - } - } elsif ($c eq 'q') { - print $quarter; - } elsif ($c eq 'w') { - print $week; - } elsif ($c eq 'H') { - printf (+pick ('%d', '%02d'), $hour); - } elsif ($c eq 'M') { - printf (+pick ('%d', '%02d'), $minute); - } elsif ($c eq 'S') { - printf (+pick ('%d', '%02d'), $second); - } elsif ($c eq '-') { - print +pick (' ', '-', '.', ',', '/'); - } elsif ($c eq ':') { - print +pick (' ', ':'); - } elsif ($c eq ' ') { - print ' '; - } elsif ($c eq 'Q') { - maybe_print_space (); - print_rand_case ('q'); - maybe_print_space (); - } elsif ($c eq 'W') { - maybe_print_space (); - print_rand_case ('wk'); - maybe_print_space (); - } elsif ($c eq '+') { - print +pick ('', '-', '+'); - } else { - die; - } - } - print "\n"; -} - -sub print_rand_case { - my ($s) = @_; - my ($case) = pick (qw (uc lc tc)); - if ($case eq 'uc') { - print uc ($s); - } elsif ($case eq 'lc') { - print lc ($s); - } elsif ($case eq 'tc') { - print ucfirst ($s); - } else { - die; - } -} - -sub maybe_print_space { - print +pick ('', ' '); -} - -sub pick { - return $_[int (my_rand ($#_ + 1))]; -} -EOF -if [ $? -ne 0 ] ; then no_result ; fi - -activity="generate PSPP syntax and data" -$PERL date-in.pl -if [ $? -ne 0 ] ; then no_result ; fi - -activity="run program" -$SUPERVISOR $PSPP -o pspp.csv date-in.pspp -if [ $? -ne 0 ] ; then no_result ; fi - -activity="compare adate.out output" -diff -u adate.out - <