1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([data output (data-out)])
19 AT_SETUP([numeric format output])
20 AT_KEYWORDS([data-out slow])
25 my @values = qw(0 2 9.5 27 271 999.95 2718 9999.995 27182 271828
26 2718281 2**39 2**333 2**-21 -2 -9.5 -27 -271 -999.95 -2718 -9999.995
27 -27182 -271828 -2718281 -2**39 -2**333 -2**-21 -0 3.125 31.25 314.125
28 3141.5 31415.875 314159.25 3141592.625 31415926.5 271828182.25
29 3214567890.5 31415926535.875 -3.125 -31.375 -314.125 -3141.5
30 -31415.875 -314159.25 -3141592.625 -31415926.5 -271828182.25
31 -3214567890.5 -31415926535.875);
33 print "SET CCA=',,,'.\n";
34 print "SET CCB='-,[[[,]]],-'.\n";
35 print "SET CCC='((,[,],))'.\n";
36 print "SET CCD=',XXX,,-'.\n";
37 print "SET CCE=',,YYY,-'.\n";
38 print "INPUT PROGRAM.\n";
39 print "STRING EXPR(A16).\n";
40 print map ("COMPUTE NUM=$_.\nCOMPUTE EXPR='$_'.\nEND CASE.\n", @values);
42 print "END INPUT PROGRAM.\n";
44 print "PRINT OUTFILE='output.txt'/EXPR.\n";
45 for my $format (qw (F COMMA DOT DOLLAR PCT E CCA CCB CCC CCD CCE N Z)) {
50 $min_w++ if $format eq 'DOLLAR' || $format eq 'PCT';
51 $min_w = 2 if $min_w == 1 && ($format =~ /^CC/);
55 for my $w ($min_w...40) {
56 my ($f) = "$format$w.$d";
57 print "PRINT OUTFILE='output.txt'/'$f: \"' NUM($f) '\"'.\n";
60 print "PRINT SPACE OUTFILE='output.txt'.\n";
64 AT_CHECK([$PERL num-out.pl > num-out.sps])
65 AT_CHECK([pspp -O format=csv num-out.sps])
66 AT_CHECK([inexactify < output.txt > output.inexact])
67 AT_CHECK([gzip -cd < $top_srcdir/tests/data/num-out.expected.cmp.gz > expout.cmp])
68 AT_DATA([num-out-decmp.pl],
74 if (my ($n) = /^\*(\d+)$/) {
77 $line[3] = " $line[3]";
78 print ' ', join ('', @line), "\n";
80 } elsif (my ($suffix) = /^\$(.*)$/) {
81 for my $c (split ('', $suffix)) {
84 print ' ', join ('', @line), "\n";
86 } elsif (my ($prefix) = /^\^(.*)$/) {
87 for my $c (split ('', $prefix)) {
89 $line[4] = "$c$line[4]";
90 print ' ', join ('', @line), "\n";
93 @line = /^([A-Z]+)(\d+)([^"]+")( *)([^%"]*)(%?")$/;
98 AT_CHECK([$PERL num-out-decmp.pl < expout.cmp > expout.exact])
99 AT_CHECK([[inexactify < expout.exact > expout.inexact]])
100 AT_DATA([num-out-compare.pl],
101 [[#! /usr/bin/perl -w
110 Getopt::Long::Configure ("bundling");
111 GetOptions ("e|exact!" => \$exact,
113 "v|verbose+" => \$verbose,
114 "h|help" => sub { usage (0) })
118 print "$0: compare expected and actual numeric formatting output\n";
119 print "usage: $0 [OPTION...] EXPECTED ACTUAL\n";
120 print "where EXPECTED is the file containing expected output\n";
121 print "and ACTUAL is the file containing actual output.\n";
123 print " -e, --exact: Require numbers to be exactly equal.\n";
124 print " (By default, small differences are permitted.)\n";
125 print " -s, --spss: Ignore most SPSS formatting bugs in EXPECTED.\n";
126 print " (A few differences are not compensated)\n";
127 print " -v, --verbose: Use once to summarize errors and differences.\n";
128 print " Use twice for details of differences.\n";
132 open (EXPECTED, '<', $ARGV[0]) or die "$ARGV[0]: open: $!\n";
133 open (ACTUAL, '<', $ARGV[1]) or die "$ARGV[1]: open: $!\n";
136 my ($approximate) = 0;
141 while (defined (my $a = <EXPECTED>) && defined (my $b = <ACTUAL>)) {
145 if ($a !~ /^\s*$/ && $a !~ /:/) {
151 my ($fmt, $a_out) = $a =~ /^ (.*): "(.*)"$/ or die;
152 my ($b_fmt, $b_out) = $b =~ /^ (.*): "(.*)"$/ or die;
153 die if $fmt ne $b_fmt;
154 die if $a_out eq $b_out;
157 if (increment ($a_out) eq $b_out || increment ($b_out) eq $a_out) {
163 if ($a_out =~ /0.*0/ && $a_out !~ /[1-9]/) {
166 } elsif ($a_out =~ /\*/ && $a_out !~ /^\*+$/) {
169 } elsif ($expr =~ /^-/
171 && $b_out =~ /-\d(\.\d*#*)?E[-+]\d\d\d/
175 } elsif ($expr =~ /^-/
176 && (($a_out !~ /-/ && $a_out =~ /[1-9]/ && $b_out =~ /-/)
177 || ($a_out =~ /^[0-9]+$/ && $b_out =~ /^\*+$/))) {
182 print "$.: $expr in $fmt: expected \"$a_out\", got \"$b_out\"\n"
188 print "Extra lines in $ARGV[0]\n";
193 print "Extra lines in $ARGV[1]\n";
198 print "$errors errors\n";
200 print "$approximate approximate matches\n";
203 print "$bad_round bad rounds\n";
204 print "$spss_wtf1 SPSS WTF 1\n";
205 print "$spss_wtf2 SPSS WTF 2\n";
206 print "$lost_sign lost signs\n";
211 # Returns the argument value incremented by one unit in its final
215 my ($last_digit, $i);
216 for ($i = 0; $i < length $_; $i++) {
217 my ($c) = substr ($_, $i, 1);
219 $last_digit = $i if $c =~ /[0-9]/;
221 return $_ if !defined $last_digit;
222 for ($i = $last_digit; $i >= 0; $i--) {
223 my ($c) = substr ($_, $i, 1);
225 substr ($_, $i, 1) = '0';
226 } elsif ($c =~ /[0-8]/) {
227 substr ($_, $i, 1) = chr (ord ($c) + 1);
231 $_ = "1$_" if $i < 0;
235 AT_CHECK([$PERL num-out-compare.pl $PSPP_NUM_OUT_COMPARE_FLAGS expout.inexact output.inexact])
238 AT_SETUP([non-ASCII custom currency formats])
239 AT_KEYWORDS([data-out])
240 AT_DATA([data-out.sps], [dnl
241 SET CCA='«,¥,€,»'.
243 DATA LIST LIST NOTABLE/x.
244 PRINT/x (F8.2) x (CCA10.2).
256 AT_CHECK([pspp -O format=csv data-out.sps], [0], [dnl
257 "data-out.sps:2: note: SHOW: CCA is «,¥,€,»."
269 1.5E+010 ¥2E+010€ @&t@
271 -2E+010«¥2E+010€»
275 AT_SETUP([binary and hexadecimal output])
276 AT_KEYWORDS([data-out])
277 AT_DATA([binhex-out.sps], [dnl
279 SET MXWARNS=10000000.
281 DATA LIST NOTABLE/x 1-10.
352 FILE HANDLE output/NAME='binhex.out'/MODE=IMAGE/LRECL=256.
353 WRITE OUTFILE=output/
354 x(p1.0) x(p2.0) x(p3.0) x(p4.0) /* 000
355 x(p2.1) x(p3.1) x(p4.1) /* 00a
356 x(p3.2) x(p4.2) /* 013
358 x(pk1.0) x(pk2.0) x(pk3.0) x(pk4.0) /* 01e
359 x(pk2.1) x(pk3.1) x(pk4.1) /* 028
360 x(pk3.2) x(pk4.2) /* 031
362 x(ib1.0) x(ib2.0) x(ib3.0) x(ib4.0) /* 03c
363 x(ib1.1) x(ib2.1) x(ib3.1) x(ib4.1) /* 046
364 x(ib1.2) x(ib2.2) x(ib3.2) x(ib4.2) /* 050
365 x(ib1.3) x(ib2.3) x(ib3.3) x(ib4.3) /* 05a
366 x(ib2.4) x(ib3.4) x(ib4.4) /* 064
367 x(ib2.5) x(ib3.5) x(ib4.5) /* 06d
368 x(ib3.6) x(ib4.6) /* 076
369 x(ib3.7) x(ib4.7) /* 07d
370 x(ib3.8) x(ib4.8) /* 084
373 x(pib1.0) x(pib2.0) x(pib3.0) x(pib4.0) /* 093
374 x(pib1.1) x(pib2.1) x(pib3.1) x(pib4.1) /* 09d
375 x(pib1.2) x(pib2.2) x(pib3.2) x(pib4.2) /* 0a7
376 x(pib1.3) x(pib2.3) x(pib3.3) x(pib4.3) /* 0b1
377 x(pib2.4) x(pib3.4) x(pib4.4) /* 0bb
378 x(pib2.5) x(pib3.5) x(pib4.5) /* 0c4
379 x(pib3.6) x(pib4.6) /* 0cd
380 x(pib3.7) x(pib4.7) /* 0d4
381 x(pib3.8) x(pib4.8) /* 0db
384 x(pibhex2) x(pibhex4) /* 0ea
385 x(pibhex6) x(pibhex8). /* 0f0
389 AT_CHECK([pspp -O format=csv binhex-out.sps])
390 AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-out.expected.gz > expout])
391 AT_CHECK([cat binhex.out], [0], [expout])
394 AT_SETUP([output valid dates])
395 AT_KEYWORDS([data-out])
396 AT_DATA([date-out.sps], [dnl
398 data list notable /x 1-30 (datetime).
401 30-6-1680 4:50:38.12301
402 24-7-1716 12:31:35.23453
403 19-6-1768 12:47:53.34505
404 2-8-1819 1:26:0.45615
405 27-3-1839 20:58:11.56677
406 19-4-1903 7:36:5.18964
407 25-8-1929 15:43:49.83132
408 29-9-1941 4:25:9.01293
409 19-4-1943 6:49:27.52375
410 7-10-1943 2:57:52.01565
411 17-3-1992 16:45:44.86529
412 25-2-1996 21:30:57.82047
414 19-4-43 6:49:27.10533
415 7-10-43 2:57:52.48229
416 17-3-92 16:45:44.65827
417 25-2-96 21:30:57.58219
418 10-11-2038 22:30:4.18347
419 18-7-2094 1:56:51.59319
421 print outfile='date.out'/x(date9) ' | ' x(date11).
422 print outfile='adate.out'/x(adate8) ' | ' x(adate10).
423 print outfile='edate.out'/x(edate8) ' | ' x(edate10).
424 print outfile='jdate.out'/x(jdate5) ' | ' x(jdate7).
425 print outfile='sdate.out'/x(sdate8) ' | ' x(sdate10).
426 print outfile='qyr.out'/x(qyr6) ' | ' x(qyr8).
427 print outfile='moyr.out'/x(moyr6) ' | ' x(moyr8).
428 print outfile='wkyr.out'/x(wkyr8) ' | ' x(wkyr10).
429 print outfile='datetime17.out'/x(datetime17).
430 print outfile='datetime18.out'/x(datetime18).
431 print outfile='datetime19.out'/x(datetime19).
432 print outfile='datetime20.out'/x(datetime20).
433 print outfile='datetime21.out'/x(datetime21).
434 print outfile='datetime22.out'/x(datetime22).
435 print outfile='datetime22.1.out'/x(datetime22.1).
436 print outfile='datetime23.2.out'/x(datetime23.2).
437 print outfile='datetime24.3.out'/x(datetime24.3).
438 print outfile='datetime25.4.out'/x(datetime25.4).
439 print outfile='datetime26.5.out'/x(datetime26.5).
440 print outfile='ymdhms16.out'/x(ymdhms16).
441 print outfile='ymdhms17.out'/x(ymdhms17).
442 print outfile='ymdhms18.out'/x(ymdhms18).
443 print outfile='ymdhms19.out'/x(ymdhms19).
444 print outfile='ymdhms20.out'/x(ymdhms20).
445 print outfile='ymdhms21.out'/x(ymdhms21).
446 print outfile='ymdhms21.1.out'/x(ymdhms21.1).
447 print outfile='ymdhms22.2.out'/x(ymdhms22.2).
448 print outfile='ymdhms23.3.out'/x(ymdhms23.3).
449 print outfile='ymdhms24.4.out'/x(ymdhms24.4).
450 print outfile='ymdhms25.5.out'/x(ymdhms25.5).
453 AT_CHECK([pspp -O format=csv date-out.sps])
454 AT_CHECK([cat date.out], [0], [dnl
455 ********* | 10-JUN-1648
456 ********* | 30-JUN-1680
457 ********* | 24-JUL-1716
458 ********* | 19-JUN-1768
459 ********* | 02-AUG-1819
460 ********* | 27-MAR-1839
461 ********* | 19-APR-1903
462 ********* | 25-AUG-1929
463 29-SEP-41 | 29-SEP-1941
464 19-APR-43 | 19-APR-1943
465 07-OCT-43 | 07-OCT-1943
466 17-MAR-92 | 17-MAR-1992
467 25-FEB-96 | 25-FEB-1996
468 29-SEP-41 | 29-SEP-1941
469 19-APR-43 | 19-APR-1943
470 07-OCT-43 | 07-OCT-1943
471 17-MAR-92 | 17-MAR-1992
472 25-FEB-96 | 25-FEB-1996
473 ********* | 10-NOV-2038
474 ********* | 18-JUL-2094
476 AT_CHECK([cat adate.out], [0], [dnl
477 ******** | 06/10/1648
478 ******** | 06/30/1680
479 ******** | 07/24/1716
480 ******** | 06/19/1768
481 ******** | 08/02/1819
482 ******** | 03/27/1839
483 ******** | 04/19/1903
484 ******** | 08/25/1929
485 09/29/41 | 09/29/1941
486 04/19/43 | 04/19/1943
487 10/07/43 | 10/07/1943
488 03/17/92 | 03/17/1992
489 02/25/96 | 02/25/1996
490 09/29/41 | 09/29/1941
491 04/19/43 | 04/19/1943
492 10/07/43 | 10/07/1943
493 03/17/92 | 03/17/1992
494 02/25/96 | 02/25/1996
495 ******** | 11/10/2038
496 ******** | 07/18/2094
498 AT_CHECK([cat edate.out], [0], [dnl
499 ******** | 10.06.1648
500 ******** | 30.06.1680
501 ******** | 24.07.1716
502 ******** | 19.06.1768
503 ******** | 02.08.1819
504 ******** | 27.03.1839
505 ******** | 19.04.1903
506 ******** | 25.08.1929
507 29.09.41 | 29.09.1941
508 19.04.43 | 19.04.1943
509 07.10.43 | 07.10.1943
510 17.03.92 | 17.03.1992
511 25.02.96 | 25.02.1996
512 29.09.41 | 29.09.1941
513 19.04.43 | 19.04.1943
514 07.10.43 | 07.10.1943
515 17.03.92 | 17.03.1992
516 25.02.96 | 25.02.1996
517 ******** | 10.11.2038
518 ******** | 18.07.2094
520 AT_CHECK([cat jdate.out], [0], [dnl
542 AT_CHECK([cat sdate.out], [0], [dnl
543 ******** | 1648/06/10
544 ******** | 1680/06/30
545 ******** | 1716/07/24
546 ******** | 1768/06/19
547 ******** | 1819/08/02
548 ******** | 1839/03/27
549 ******** | 1903/04/19
550 ******** | 1929/08/25
551 41/09/29 | 1941/09/29
552 43/04/19 | 1943/04/19
553 43/10/07 | 1943/10/07
554 92/03/17 | 1992/03/17
555 96/02/25 | 1996/02/25
556 41/09/29 | 1941/09/29
557 43/04/19 | 1943/04/19
558 43/10/07 | 1943/10/07
559 92/03/17 | 1992/03/17
560 96/02/25 | 1996/02/25
561 ******** | 2038/11/10
562 ******** | 2094/07/18
564 AT_CHECK([cat qyr.out], [0], [dnl
586 AT_CHECK([cat moyr.out], [0], [dnl
608 AT_CHECK([cat wkyr.out], [0], [dnl
609 ******** | 24 WK 1648
610 ******** | 26 WK 1680
611 ******** | 30 WK 1716
612 ******** | 25 WK 1768
613 ******** | 31 WK 1819
614 ******** | 13 WK 1839
615 ******** | 16 WK 1903
616 ******** | 34 WK 1929
617 39 WK 41 | 39 WK 1941
618 16 WK 43 | 16 WK 1943
619 40 WK 43 | 40 WK 1943
620 11 WK 92 | 11 WK 1992
622 39 WK 41 | 39 WK 1941
623 16 WK 43 | 16 WK 1943
624 40 WK 43 | 40 WK 1943
625 11 WK 92 | 11 WK 1992
627 ******** | 45 WK 2038
628 ******** | 29 WK 2094
630 AT_CHECK([cat datetime17.out], [0], [dnl
652 AT_CHECK([cat datetime18.out], [0], [dnl
674 AT_CHECK([cat datetime19.out], [0], [dnl
696 AT_CHECK([cat datetime20.out], [0], [dnl
718 AT_CHECK([cat datetime21.out], [0], [dnl
740 AT_CHECK([cat datetime22.out], [0], [dnl
762 AT_CHECK([cat datetime22.1.out], [0], [dnl
763 10-JUN-1648 00:00:00.0
764 30-JUN-1680 04:50:38.1
765 24-JUL-1716 12:31:35.2
766 19-JUN-1768 12:47:53.3
767 02-AUG-1819 01:26:00.5
768 27-MAR-1839 20:58:11.6
769 19-APR-1903 07:36:05.2
770 25-AUG-1929 15:43:49.8
771 29-SEP-1941 04:25:09.0
772 19-APR-1943 06:49:27.5
773 07-OCT-1943 02:57:52.0
774 17-MAR-1992 16:45:44.9
775 25-FEB-1996 21:30:57.8
776 29-SEP-1941 04:25:09.2
777 19-APR-1943 06:49:27.1
778 07-OCT-1943 02:57:52.5
779 17-MAR-1992 16:45:44.7
780 25-FEB-1996 21:30:57.6
781 10-NOV-2038 22:30:04.2
782 18-JUL-2094 01:56:51.6
784 AT_CHECK([cat datetime23.2.out], [0], [dnl
785 10-JUN-1648 00:00:00.00
786 30-JUN-1680 04:50:38.12
787 24-JUL-1716 12:31:35.23
788 19-JUN-1768 12:47:53.35
789 02-AUG-1819 01:26:00.46
790 27-MAR-1839 20:58:11.57
791 19-APR-1903 07:36:05.19
792 25-AUG-1929 15:43:49.83
793 29-SEP-1941 04:25:09.01
794 19-APR-1943 06:49:27.52
795 07-OCT-1943 02:57:52.02
796 17-MAR-1992 16:45:44.87
797 25-FEB-1996 21:30:57.82
798 29-SEP-1941 04:25:09.15
799 19-APR-1943 06:49:27.11
800 07-OCT-1943 02:57:52.48
801 17-MAR-1992 16:45:44.66
802 25-FEB-1996 21:30:57.58
803 10-NOV-2038 22:30:04.18
804 18-JUL-2094 01:56:51.59
806 AT_CHECK([cat datetime24.3.out], [0], [dnl
807 10-JUN-1648 00:00:00.000
808 30-JUN-1680 04:50:38.123
809 24-JUL-1716 12:31:35.235
810 19-JUN-1768 12:47:53.345
811 02-AUG-1819 01:26:00.456
812 27-MAR-1839 20:58:11.567
813 19-APR-1903 07:36:05.190
814 25-AUG-1929 15:43:49.831
815 29-SEP-1941 04:25:09.013
816 19-APR-1943 06:49:27.524
817 07-OCT-1943 02:57:52.016
818 17-MAR-1992 16:45:44.865
819 25-FEB-1996 21:30:57.820
820 29-SEP-1941 04:25:09.154
821 19-APR-1943 06:49:27.105
822 07-OCT-1943 02:57:52.482
823 17-MAR-1992 16:45:44.658
824 25-FEB-1996 21:30:57.582
825 10-NOV-2038 22:30:04.183
826 18-JUL-2094 01:56:51.593
828 AT_CHECK([cat datetime25.4.out], [0], [dnl
829 10-JUN-1648 00:00:00.0000
830 30-JUN-1680 04:50:38.1230
831 24-JUL-1716 12:31:35.2345
832 19-JUN-1768 12:47:53.3450
833 02-AUG-1819 01:26:00.4562
834 27-MAR-1839 20:58:11.5668
835 19-APR-1903 07:36:05.1896
836 25-AUG-1929 15:43:49.8313
837 29-SEP-1941 04:25:09.0129
838 19-APR-1943 06:49:27.5238
839 07-OCT-1943 02:57:52.0156
840 17-MAR-1992 16:45:44.8653
841 25-FEB-1996 21:30:57.8205
842 29-SEP-1941 04:25:09.1539
843 19-APR-1943 06:49:27.1053
844 07-OCT-1943 02:57:52.4823
845 17-MAR-1992 16:45:44.6583
846 25-FEB-1996 21:30:57.5822
847 10-NOV-2038 22:30:04.1835
848 18-JUL-2094 01:56:51.5932
850 AT_CHECK([cat datetime26.5.out], [0], [dnl
851 10-JUN-1648 00:00:00.00000
852 30-JUN-1680 04:50:38.12301
853 24-JUL-1716 12:31:35.23453
854 19-JUN-1768 12:47:53.34505
855 02-AUG-1819 01:26:00.45615
856 27-MAR-1839 20:58:11.56677
857 19-APR-1903 07:36:05.18964
858 25-AUG-1929 15:43:49.83132
859 29-SEP-1941 04:25:09.01293
860 19-APR-1943 06:49:27.52375
861 07-OCT-1943 02:57:52.01565
862 17-MAR-1992 16:45:44.86529
863 25-FEB-1996 21:30:57.82047
864 29-SEP-1941 04:25:09.15395
865 19-APR-1943 06:49:27.10533
866 07-OCT-1943 02:57:52.48229
867 17-MAR-1992 16:45:44.65827
868 25-FEB-1996 21:30:57.58219
869 10-NOV-2038 22:30:04.18347
870 18-JUL-2094 01:56:51.59319
872 AT_CHECK([cat ymdhms16.out], [0], [dnl
894 AT_CHECK([cat ymdhms17.out], [0], [dnl
916 AT_CHECK([cat ymdhms18.out], [0], [dnl
938 AT_CHECK([cat ymdhms19.out], [0], [dnl
960 AT_CHECK([cat ymdhms20.out], [0], [dnl
982 AT_CHECK([cat ymdhms21.out], [0], [dnl
1004 AT_CHECK([cat ymdhms21.1.out], [0], [dnl
1005 1648-06-10 00:00:00.0
1006 1680-06-30 04:50:38.1
1007 1716-07-24 12:31:35.2
1008 1768-06-19 12:47:53.3
1009 1819-08-02 01:26:00.5
1010 1839-03-27 20:58:11.6
1011 1903-04-19 07:36:05.2
1012 1929-08-25 15:43:49.8
1013 1941-09-29 04:25:09.0
1014 1943-04-19 06:49:27.5
1015 1943-10-07 02:57:52.0
1016 1992-03-17 16:45:44.9
1017 1996-02-25 21:30:57.8
1018 1941-09-29 04:25:09.2
1019 1943-04-19 06:49:27.1
1020 1943-10-07 02:57:52.5
1021 1992-03-17 16:45:44.7
1022 1996-02-25 21:30:57.6
1023 2038-11-10 22:30:04.2
1024 2094-07-18 01:56:51.6
1026 AT_CHECK([cat ymdhms22.2.out], [0], [dnl
1027 1648-06-10 00:00:00.00
1028 1680-06-30 04:50:38.12
1029 1716-07-24 12:31:35.23
1030 1768-06-19 12:47:53.35
1031 1819-08-02 01:26:00.46
1032 1839-03-27 20:58:11.57
1033 1903-04-19 07:36:05.19
1034 1929-08-25 15:43:49.83
1035 1941-09-29 04:25:09.01
1036 1943-04-19 06:49:27.52
1037 1943-10-07 02:57:52.02
1038 1992-03-17 16:45:44.87
1039 1996-02-25 21:30:57.82
1040 1941-09-29 04:25:09.15
1041 1943-04-19 06:49:27.11
1042 1943-10-07 02:57:52.48
1043 1992-03-17 16:45:44.66
1044 1996-02-25 21:30:57.58
1045 2038-11-10 22:30:04.18
1046 2094-07-18 01:56:51.59
1048 AT_CHECK([cat ymdhms23.3.out], [0], [dnl
1049 1648-06-10 00:00:00.000
1050 1680-06-30 04:50:38.123
1051 1716-07-24 12:31:35.235
1052 1768-06-19 12:47:53.345
1053 1819-08-02 01:26:00.456
1054 1839-03-27 20:58:11.567
1055 1903-04-19 07:36:05.190
1056 1929-08-25 15:43:49.831
1057 1941-09-29 04:25:09.013
1058 1943-04-19 06:49:27.524
1059 1943-10-07 02:57:52.016
1060 1992-03-17 16:45:44.865
1061 1996-02-25 21:30:57.820
1062 1941-09-29 04:25:09.154
1063 1943-04-19 06:49:27.105
1064 1943-10-07 02:57:52.482
1065 1992-03-17 16:45:44.658
1066 1996-02-25 21:30:57.582
1067 2038-11-10 22:30:04.183
1068 2094-07-18 01:56:51.593
1070 AT_CHECK([cat ymdhms24.4.out], [0], [dnl
1071 1648-06-10 00:00:00.0000
1072 1680-06-30 04:50:38.1230
1073 1716-07-24 12:31:35.2345
1074 1768-06-19 12:47:53.3450
1075 1819-08-02 01:26:00.4562
1076 1839-03-27 20:58:11.5668
1077 1903-04-19 07:36:05.1896
1078 1929-08-25 15:43:49.8313
1079 1941-09-29 04:25:09.0129
1080 1943-04-19 06:49:27.5238
1081 1943-10-07 02:57:52.0156
1082 1992-03-17 16:45:44.8653
1083 1996-02-25 21:30:57.8205
1084 1941-09-29 04:25:09.1539
1085 1943-04-19 06:49:27.1053
1086 1943-10-07 02:57:52.4823
1087 1992-03-17 16:45:44.6583
1088 1996-02-25 21:30:57.5822
1089 2038-11-10 22:30:04.1835
1090 2094-07-18 01:56:51.5932
1092 AT_CHECK([cat ymdhms25.5.out], [0], [dnl
1093 1648-06-10 00:00:00.00000
1094 1680-06-30 04:50:38.12301
1095 1716-07-24 12:31:35.23453
1096 1768-06-19 12:47:53.34505
1097 1819-08-02 01:26:00.45615
1098 1839-03-27 20:58:11.56677
1099 1903-04-19 07:36:05.18964
1100 1929-08-25 15:43:49.83132
1101 1941-09-29 04:25:09.01293
1102 1943-04-19 06:49:27.52375
1103 1943-10-07 02:57:52.01565
1104 1992-03-17 16:45:44.86529
1105 1996-02-25 21:30:57.82047
1106 1941-09-29 04:25:09.15395
1107 1943-04-19 06:49:27.10533
1108 1943-10-07 02:57:52.48229
1109 1992-03-17 16:45:44.65827
1110 1996-02-25 21:30:57.58219
1111 2038-11-10 22:30:04.18347
1112 2094-07-18 01:56:51.59319
1116 AT_SETUP([output invalid dates])
1117 AT_KEYWORDS([data-out])
1118 AT_DATA([bad-date.sps], [dnl
1121 data list list notable/x.
1127 print outfile='bad-date.out'/x(date9) ' | ' x(date11).
1128 print outfile='bad-date.out'/x(adate8) ' | ' x(adate10).
1129 print outfile='bad-date.out'/x(edate8) ' | ' x(edate10).
1130 print outfile='bad-date.out'/x(jdate5) ' | ' x(jdate7).
1131 print outfile='bad-date.out'/x(sdate8) ' | ' x(sdate10).
1132 print outfile='bad-date.out'/x(qyr6) ' | ' x(qyr8).
1133 print outfile='bad-date.out'/x(moyr6) ' | ' x(moyr8).
1134 print outfile='bad-date.out'/x(wkyr8) ' | ' x(wkyr10).
1135 print outfile='bad-date.out'/x(datetime17).
1136 print outfile='bad-date.out'/x(datetime18).
1137 print outfile='bad-date.out'/x(datetime19).
1138 print outfile='bad-date.out'/x(datetime20).
1139 print outfile='bad-date.out'/x(datetime21).
1140 print outfile='bad-date.out'/x(datetime22).
1141 print outfile='bad-date.out'/x(datetime22.1).
1142 print outfile='bad-date.out'/x(datetime23.2).
1143 print outfile='bad-date.out'/x(datetime24.3).
1144 print outfile='bad-date.out'/x(datetime25.4).
1145 print outfile='bad-date.out'/x(datetime26.5).
1148 AT_CHECK([pspp -O format=csv bad-date.sps])
1149 AT_CHECK([cat bad-date.out], [0], [dnl
1188 ********* | ***********
1189 ******** | **********
1190 ******** | **********
1192 ******** | **********
1195 ******** | **********
1199 28-MAY-**** 05:20:00
1200 28-MAY-**** 05:20:00
1201 28-MAY-**** 05:20:00
1202 28-MAY-**** 05:20:00.0
1203 28-MAY-**** 05:20:00.00
1204 28-MAY-**** 05:20:00.000
1205 28-MAY-**** 05:20:00.0000
1206 28-MAY-**** 05:20:00.00000
1210 AT_SETUP([time output])
1211 AT_KEYWORDS([data-out])
1212 AT_DATA([time-out.sps], [dnl
1214 data list notable /x 1-30 (dtime).
1417 print outfile='time5.out'/x(time5).
1418 print outfile='time6.out'/x(time6).
1419 print outfile='time7.out'/x(time7).
1420 print outfile='time8.out'/x(time8).
1421 print outfile='time9.out'/x(time9).
1422 print outfile='time10.out'/x(time10).
1423 print outfile='time10.1.out'/x(time10.1).
1424 print outfile='time11.out'/x(time11).
1425 print outfile='time11.1.out'/x(time11.1).
1426 print outfile='time11.2.out'/x(time11.2).
1427 print outfile='time12.out'/x(time12).
1428 print outfile='time12.1.out'/x(time12.1).
1429 print outfile='time12.2.out'/x(time12.2).
1430 print outfile='time12.3.out'/x(time12.3).
1431 print outfile='time13.out'/x(time13).
1432 print outfile='time13.1.out'/x(time13.1).
1433 print outfile='time13.2.out'/x(time13.2).
1434 print outfile='time13.3.out'/x(time13.3).
1435 print outfile='time13.4.out'/x(time13.4).
1436 print outfile='time14.out'/x(time14).
1437 print outfile='time14.1.out'/x(time14.1).
1438 print outfile='time14.2.out'/x(time14.2).
1439 print outfile='time14.3.out'/x(time14.3).
1440 print outfile='time14.4.out'/x(time14.4).
1441 print outfile='time14.5.out'/x(time14.5).
1442 print outfile='time15.out'/x(time15).
1443 print outfile='time15.1.out'/x(time15.1).
1444 print outfile='time15.2.out'/x(time15.2).
1445 print outfile='time15.3.out'/x(time15.3).
1446 print outfile='time15.4.out'/x(time15.4).
1447 print outfile='time15.5.out'/x(time15.5).
1448 print outfile='time15.6.out'/x(time15.6).
1449 print outfile='dtime8.out'/x(dtime8).
1450 print outfile='dtime9.out'/x(dtime9).
1451 print outfile='dtime10.out'/x(dtime10).
1452 print outfile='dtime11.out'/x(dtime11).
1453 print outfile='dtime12.out'/x(dtime12).
1454 print outfile='dtime13.out'/x(dtime13).
1455 print outfile='dtime13.1.out'/x(dtime13.1).
1456 print outfile='dtime14.out'/x(dtime14).
1457 print outfile='dtime14.1.out'/x(dtime14.1).
1458 print outfile='dtime14.2.out'/x(dtime14.2).
1459 print outfile='dtime15.out'/x(dtime15).
1460 print outfile='dtime15.1.out'/x(dtime15.1).
1461 print outfile='dtime15.2.out'/x(dtime15.2).
1462 print outfile='dtime15.3.out'/x(dtime15.3).
1463 print outfile='dtime16.out'/x(dtime16).
1464 print outfile='dtime16.1.out'/x(dtime16.1).
1465 print outfile='dtime16.2.out'/x(dtime16.2).
1466 print outfile='dtime16.3.out'/x(dtime16.3).
1467 print outfile='dtime16.4.out'/x(dtime16.4).
1468 print outfile='dtime17.out'/x(dtime17).
1469 print outfile='dtime17.1.out'/x(dtime17.1).
1470 print outfile='dtime17.2.out'/x(dtime17.2).
1471 print outfile='dtime17.3.out'/x(dtime17.3).
1472 print outfile='dtime17.4.out'/x(dtime17.4).
1473 print outfile='dtime17.5.out'/x(dtime17.5).
1474 print outfile='dtime18.out'/x(dtime18).
1475 print outfile='dtime18.1.out'/x(dtime18.1).
1476 print outfile='dtime18.2.out'/x(dtime18.2).
1477 print outfile='dtime18.3.out'/x(dtime18.3).
1478 print outfile='dtime18.4.out'/x(dtime18.4).
1479 print outfile='dtime18.5.out'/x(dtime18.5).
1480 print outfile='dtime18.6.out'/x(dtime18.6).
1481 print outfile='mtime5.out'/x(mtime5).
1482 print outfile='mtime6.out'/x(mtime6).
1483 print outfile='mtime7.out'/x(mtime7).
1484 print outfile='mtime7.1.out'/x(mtime7.1).
1485 print outfile='mtime8.out'/x(mtime8).
1486 print outfile='mtime8.1.out'/x(mtime8.1).
1487 print outfile='mtime8.2.out'/x(mtime8.2).
1488 print outfile='mtime9.out'/x(mtime9).
1489 print outfile='mtime9.1.out'/x(mtime9.1).
1490 print outfile='mtime9.2.out'/x(mtime9.2).
1491 print outfile='mtime9.3.out'/x(mtime9.3).
1492 print outfile='mtime10.out'/x(mtime10).
1493 print outfile='mtime10.1.out'/x(mtime10.1).
1494 print outfile='mtime10.2.out'/x(mtime10.2).
1495 print outfile='mtime10.3.out'/x(mtime10.3).
1496 print outfile='mtime10.4.out'/x(mtime10.4).
1497 print outfile='mtime11.out'/x(mtime11).
1498 print outfile='mtime11.1.out'/x(mtime11.1).
1499 print outfile='mtime11.2.out'/x(mtime11.2).
1500 print outfile='mtime11.3.out'/x(mtime11.3).
1501 print outfile='mtime11.4.out'/x(mtime11.4).
1502 print outfile='mtime11.5.out'/x(mtime11.5).
1503 print outfile='mtime12.5.out'/x(mtime12.5).
1504 print outfile='mtime13.5.out'/x(mtime13.5).
1505 print outfile='mtime14.5.out'/x(mtime14.5).
1506 print outfile='mtime15.5.out'/x(mtime15.5).
1507 print outfile='mtime16.5.out'/x(mtime16.5).
1510 AT_CHECK([pspp -O format=csv time-out.sps])
1511 AT_CHECK([cat time5.out], [0], [dnl
1713 AT_CHECK([cat time6.out], [0], [dnl
1915 AT_CHECK([cat time7.out], [0], [dnl
2117 AT_CHECK([cat time8.out], [0], [dnl
2319 AT_CHECK([cat time9.out], [0], [dnl
2521 AT_CHECK([cat time10.out], [0], [dnl
2723 AT_CHECK([cat time10.1.out], [0], [dnl
2925 AT_CHECK([cat time11.out], [0], [dnl
3127 AT_CHECK([cat time11.1.out], [0], [dnl
3329 AT_CHECK([cat time11.2.out], [0], [dnl
3531 AT_CHECK([cat time12.out], [0], [dnl
3733 AT_CHECK([cat time12.1.out], [0], [dnl
3935 AT_CHECK([cat time12.2.out], [0], [dnl
4137 AT_CHECK([cat time12.3.out], [0], [dnl
4339 AT_CHECK([cat time13.out], [0], [dnl
4541 AT_CHECK([cat time13.1.out], [0], [dnl
4743 AT_CHECK([cat time13.2.out], [0], [dnl
4945 AT_CHECK([cat time13.3.out], [0], [dnl
5147 AT_CHECK([cat time13.4.out], [0], [dnl
5349 AT_CHECK([cat time14.out], [0], [dnl
5551 AT_CHECK([cat time14.1.out], [0], [dnl
5753 AT_CHECK([cat time14.2.out], [0], [dnl
5955 AT_CHECK([cat time14.3.out], [0], [dnl
6157 AT_CHECK([cat time14.4.out], [0], [dnl
6359 AT_CHECK([cat time14.5.out], [0], [dnl
6561 AT_CHECK([cat time15.out], [0], [dnl
6763 AT_CHECK([cat time15.1.out], [0], [dnl
6965 AT_CHECK([cat time15.2.out], [0], [dnl
7167 AT_CHECK([cat time15.3.out], [0], [dnl
7369 AT_CHECK([cat time15.4.out], [0], [dnl
7571 AT_CHECK([cat time15.5.out], [0], [dnl
7773 AT_CHECK([cat time15.6.out], [0], [dnl
7975 AT_CHECK([cat dtime8.out], [0], [dnl
8177 AT_CHECK([cat dtime9.out], [0], [dnl
8379 AT_CHECK([cat dtime10.out], [0], [dnl
8581 AT_CHECK([cat dtime11.out], [0], [dnl
8783 AT_CHECK([cat dtime12.out], [0], [dnl
8985 AT_CHECK([cat dtime13.out], [0], [dnl
9187 AT_CHECK([cat dtime13.1.out], [0], [dnl
9389 AT_CHECK([cat dtime14.out], [0], [dnl
9591 AT_CHECK([cat dtime14.1.out], [0], [dnl
9793 AT_CHECK([cat dtime14.2.out], [0], [dnl
9995 AT_CHECK([cat dtime15.out], [0], [dnl
10197 AT_CHECK([cat dtime15.1.out], [0], [dnl
10399 AT_CHECK([cat dtime15.2.out], [0], [dnl
10601 AT_CHECK([cat dtime15.3.out], [0], [dnl
10803 AT_CHECK([cat dtime16.out], [0], [dnl
11005 AT_CHECK([cat dtime16.1.out], [0], [dnl
11207 AT_CHECK([cat dtime16.2.out], [0], [dnl
11409 AT_CHECK([cat dtime16.3.out], [0], [dnl
11611 AT_CHECK([cat dtime16.4.out], [0], [dnl
11813 AT_CHECK([cat dtime17.out], [0], [dnl
12015 AT_CHECK([cat dtime17.1.out], [0], [dnl
12217 AT_CHECK([cat dtime17.2.out], [0], [dnl
12419 AT_CHECK([cat dtime17.3.out], [0], [dnl
12621 AT_CHECK([cat dtime17.4.out], [0], [dnl
12823 AT_CHECK([cat dtime17.5.out], [0], [dnl
13025 AT_CHECK([cat dtime18.out], [0], [dnl
13227 AT_CHECK([cat dtime18.1.out], [0], [dnl
13429 AT_CHECK([cat dtime18.2.out], [0], [dnl
13631 AT_CHECK([cat dtime18.3.out], [0], [dnl
13833 AT_CHECK([cat dtime18.4.out], [0], [dnl
14035 AT_CHECK([cat dtime18.5.out], [0], [dnl
14237 AT_CHECK([cat dtime18.6.out], [0], [dnl
14439 AT_CHECK([cat mtime5.out], [0], [dnl
14641 AT_CHECK([cat mtime6.out], [0], [dnl
14843 AT_CHECK([cat mtime7.out], [0], [dnl
15045 AT_CHECK([cat mtime7.1.out], [0], [dnl
15247 AT_CHECK([cat mtime8.out], [0], [dnl
15449 AT_CHECK([cat mtime8.1.out], [0], [dnl
15651 AT_CHECK([cat mtime8.2.out], [0], [dnl
15853 AT_CHECK([cat mtime9.out], [0], [dnl
16055 AT_CHECK([cat mtime9.1.out], [0], [dnl
16257 AT_CHECK([cat mtime9.2.out], [0], [dnl
16459 AT_CHECK([cat mtime9.3.out], [0], [dnl
16661 AT_CHECK([cat mtime10.out], [0], [dnl
16863 AT_CHECK([cat mtime10.1.out], [0], [dnl
17065 AT_CHECK([cat mtime10.2.out], [0], [dnl
17267 AT_CHECK([cat mtime10.3.out], [0], [dnl
17469 AT_CHECK([cat mtime10.4.out], [0], [dnl
17671 AT_CHECK([cat mtime11.out], [0], [dnl
17873 AT_CHECK([cat mtime11.1.out], [0], [dnl
18075 AT_CHECK([cat mtime11.2.out], [0], [dnl
18277 AT_CHECK([cat mtime11.3.out], [0], [dnl
18479 AT_CHECK([cat mtime11.4.out], [0], [dnl
18681 AT_CHECK([cat mtime11.5.out], [0], [dnl
18883 AT_CHECK([cat mtime12.5.out], [0], [dnl
19085 AT_CHECK([cat mtime13.5.out], [0], [dnl
19287 AT_CHECK([cat mtime14.5.out], [0], [dnl
19489 AT_CHECK([cat mtime15.5.out], [0], [dnl
19691 AT_CHECK([cat mtime16.5.out], [0], [dnl
19895 AT_SETUP([MONTH output])
19896 AT_KEYWORDS([data-out])
19897 AT_DATA([month-out.sps], [dnl
19899 set mxwarns=10000000.
19900 data list notable/x 1-10.
19926 print outfile='month-out.out'/x(month3).
19927 print outfile='month-out.out'/x(month4).
19928 print outfile='month-out.out'/x(month5).
19929 print outfile='month-out.out'/x(month6).
19930 print outfile='month-out.out'/x(month7).
19931 print outfile='month-out.out'/x(month8).
19932 print outfile='month-out.out'/x(month9).
19933 print outfile='month-out.out'/x(month10).
19934 print outfile='month-out.out'/x(month11).
19935 print outfile='month-out.out'/x(month12).
19936 print outfile='month-out.out'/x(month13).
19937 print outfile='month-out.out'/x(month14).
19938 print outfile='month-out.out'/x(month15).
19939 print outfile='month-out.out'/x(month16).
19940 print outfile='month-out.out'/x(month17).
19941 print outfile='month-out.out'/x(month18).
19942 print outfile='month-out.out'/x(month19).
19943 print outfile='month-out.out'/x(month20).
19944 print outfile='month-out.out'/x(month21).
19945 print outfile='month-out.out'/x(month22).
19946 print outfile='month-out.out'/x(month23).
19947 print outfile='month-out.out'/x(month24).
19948 print outfile='month-out.out'/x(month25).
19949 print outfile='month-out.out'/x(month26).
19950 print outfile='month-out.out'/x(month27).
19951 print outfile='month-out.out'/x(month28).
19952 print outfile='month-out.out'/x(month29).
19953 print outfile='month-out.out'/x(month30).
19954 print outfile='month-out.out'/x(month31).
19955 print outfile='month-out.out'/x(month32).
19956 print outfile='month-out.out'/x(month33).
19957 print outfile='month-out.out'/x(month34).
19958 print outfile='month-out.out'/x(month35).
19959 print outfile='month-out.out'/x(month36).
19960 print outfile='month-out.out'/x(month37).
19961 print outfile='month-out.out'/x(month38).
19962 print outfile='month-out.out'/x(month39).
19963 print outfile='month-out.out'/x(month40).
19966 AT_CHECK([pspp -O format=csv month-out.sps], [1], [stdout])
19967 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
19969 38 error: Month number 0.000000 is not between 1 and 12.
19970 38 error: Month number 0.500000 is not between 1 and 12.
19971 38 error: Month number 0.900000 is not between 1 and 12.
19972 38 error: Month number 13.000000 is not between 1 and 12.
19974 AT_CHECK([cat month-out.out], [0], [dnl
20852 AT_SETUP([WKDAY output])
20853 AT_KEYWORDS([data-out])
20854 AT_DATA([wkday-out.sps], [dnl
20855 set mxwarns=10000000.
20856 set mxerrs=10000000.
20857 data list notable/x 1-10.
20878 do repeat format=wkday2 to wkday40.
20879 print outfile='wkday-out.out'/x(format).
20883 AT_CHECK([pspp -O format=csv wkday-out.sps], [1], [stdout])
20884 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
20886 39 error: Weekday number 0.000000 is not between 1 and 7.
20887 39 error: Weekday number 0.500000 is not between 1 and 7.
20888 39 error: Weekday number 0.900000 is not between 1 and 7.
20889 39 error: Weekday number 8.000000 is not between 1 and 7.
20891 AT_CHECK([cat wkday-out.out], [0], [dnl
21597 dnl This checks for a regression where AHEX output would crash due to
21598 dnl dereferencing string data as a pointer, for string widths between
21599 dnl 5 and 8, inclusive.
21600 AT_SETUP([AHEX output bug])
21601 AT_KEYWORDS([data-out])
21602 AT_DATA([ahex.sps], [
21603 DATA LIST NOTABLE /s (a8).
21607 FORMATS s (AHEX16).
21610 AT_CHECK([pspp -O format=csv ahex.sps], [0], [dnl