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])
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
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@
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).
442 AT_CHECK([pspp -O format=csv date-out.sps])
443 AT_CHECK([cat date.out], [0], [dnl
444 ********* | 10-JUN-1648
445 ********* | 30-JUN-1680
446 ********* | 24-JUL-1716
447 ********* | 19-JUN-1768
448 ********* | 02-AUG-1819
449 ********* | 27-MAR-1839
450 ********* | 19-APR-1903
451 ********* | 25-AUG-1929
452 29-SEP-41 | 29-SEP-1941
453 19-APR-43 | 19-APR-1943
454 07-OCT-43 | 07-OCT-1943
455 17-MAR-92 | 17-MAR-1992
456 25-FEB-96 | 25-FEB-1996
457 29-SEP-41 | 29-SEP-1941
458 19-APR-43 | 19-APR-1943
459 07-OCT-43 | 07-OCT-1943
460 17-MAR-92 | 17-MAR-1992
461 25-FEB-96 | 25-FEB-1996
462 ********* | 10-NOV-2038
463 ********* | 18-JUL-2094
465 AT_CHECK([cat adate.out], [0], [dnl
466 ******** | 06/10/1648
467 ******** | 06/30/1680
468 ******** | 07/24/1716
469 ******** | 06/19/1768
470 ******** | 08/02/1819
471 ******** | 03/27/1839
472 ******** | 04/19/1903
473 ******** | 08/25/1929
474 09/29/41 | 09/29/1941
475 04/19/43 | 04/19/1943
476 10/07/43 | 10/07/1943
477 03/17/92 | 03/17/1992
478 02/25/96 | 02/25/1996
479 09/29/41 | 09/29/1941
480 04/19/43 | 04/19/1943
481 10/07/43 | 10/07/1943
482 03/17/92 | 03/17/1992
483 02/25/96 | 02/25/1996
484 ******** | 11/10/2038
485 ******** | 07/18/2094
487 AT_CHECK([cat edate.out], [0], [dnl
488 ******** | 10.06.1648
489 ******** | 30.06.1680
490 ******** | 24.07.1716
491 ******** | 19.06.1768
492 ******** | 02.08.1819
493 ******** | 27.03.1839
494 ******** | 19.04.1903
495 ******** | 25.08.1929
496 29.09.41 | 29.09.1941
497 19.04.43 | 19.04.1943
498 07.10.43 | 07.10.1943
499 17.03.92 | 17.03.1992
500 25.02.96 | 25.02.1996
501 29.09.41 | 29.09.1941
502 19.04.43 | 19.04.1943
503 07.10.43 | 07.10.1943
504 17.03.92 | 17.03.1992
505 25.02.96 | 25.02.1996
506 ******** | 10.11.2038
507 ******** | 18.07.2094
509 AT_CHECK([cat jdate.out], [0], [dnl
531 AT_CHECK([cat sdate.out], [0], [dnl
532 ******** | 1648/06/10
533 ******** | 1680/06/30
534 ******** | 1716/07/24
535 ******** | 1768/06/19
536 ******** | 1819/08/02
537 ******** | 1839/03/27
538 ******** | 1903/04/19
539 ******** | 1929/08/25
540 41/09/29 | 1941/09/29
541 43/04/19 | 1943/04/19
542 43/10/07 | 1943/10/07
543 92/03/17 | 1992/03/17
544 96/02/25 | 1996/02/25
545 41/09/29 | 1941/09/29
546 43/04/19 | 1943/04/19
547 43/10/07 | 1943/10/07
548 92/03/17 | 1992/03/17
549 96/02/25 | 1996/02/25
550 ******** | 2038/11/10
551 ******** | 2094/07/18
553 AT_CHECK([cat qyr.out], [0], [dnl
575 AT_CHECK([cat moyr.out], [0], [dnl
597 AT_CHECK([cat wkyr.out], [0], [dnl
598 ******** | 24 WK 1648
599 ******** | 26 WK 1680
600 ******** | 30 WK 1716
601 ******** | 25 WK 1768
602 ******** | 31 WK 1819
603 ******** | 13 WK 1839
604 ******** | 16 WK 1903
605 ******** | 34 WK 1929
606 39 WK 41 | 39 WK 1941
607 16 WK 43 | 16 WK 1943
608 40 WK 43 | 40 WK 1943
609 11 WK 92 | 11 WK 1992
611 39 WK 41 | 39 WK 1941
612 16 WK 43 | 16 WK 1943
613 40 WK 43 | 40 WK 1943
614 11 WK 92 | 11 WK 1992
616 ******** | 45 WK 2038
617 ******** | 29 WK 2094
619 AT_CHECK([cat datetime17.out], [0], [dnl
641 AT_CHECK([cat datetime18.out], [0], [dnl
663 AT_CHECK([cat datetime19.out], [0], [dnl
685 AT_CHECK([cat datetime20.out], [0], [dnl
707 AT_CHECK([cat datetime21.out], [0], [dnl
729 AT_CHECK([cat datetime22.out], [0], [dnl
751 AT_CHECK([cat datetime22.1.out], [0], [dnl
752 10-JUN-1648 00:00:00.0
753 30-JUN-1680 04:50:38.1
754 24-JUL-1716 12:31:35.2
755 19-JUN-1768 12:47:53.3
756 02-AUG-1819 01:26:00.5
757 27-MAR-1839 20:58:11.6
758 19-APR-1903 07:36:05.2
759 25-AUG-1929 15:43:49.8
760 29-SEP-1941 04:25:09.0
761 19-APR-1943 06:49:27.5
762 07-OCT-1943 02:57:52.0
763 17-MAR-1992 16:45:44.9
764 25-FEB-1996 21:30:57.8
765 29-SEP-1941 04:25:09.2
766 19-APR-1943 06:49:27.1
767 07-OCT-1943 02:57:52.5
768 17-MAR-1992 16:45:44.7
769 25-FEB-1996 21:30:57.6
770 10-NOV-2038 22:30:04.2
771 18-JUL-2094 01:56:51.6
773 AT_CHECK([cat datetime23.2.out], [0], [dnl
774 10-JUN-1648 00:00:00.00
775 30-JUN-1680 04:50:38.12
776 24-JUL-1716 12:31:35.23
777 19-JUN-1768 12:47:53.35
778 02-AUG-1819 01:26:00.46
779 27-MAR-1839 20:58:11.57
780 19-APR-1903 07:36:05.19
781 25-AUG-1929 15:43:49.83
782 29-SEP-1941 04:25:09.01
783 19-APR-1943 06:49:27.52
784 07-OCT-1943 02:57:52.02
785 17-MAR-1992 16:45:44.87
786 25-FEB-1996 21:30:57.82
787 29-SEP-1941 04:25:09.15
788 19-APR-1943 06:49:27.11
789 07-OCT-1943 02:57:52.48
790 17-MAR-1992 16:45:44.66
791 25-FEB-1996 21:30:57.58
792 10-NOV-2038 22:30:04.18
793 18-JUL-2094 01:56:51.59
795 AT_CHECK([cat datetime24.3.out], [0], [dnl
796 10-JUN-1648 00:00:00.000
797 30-JUN-1680 04:50:38.123
798 24-JUL-1716 12:31:35.235
799 19-JUN-1768 12:47:53.345
800 02-AUG-1819 01:26:00.456
801 27-MAR-1839 20:58:11.567
802 19-APR-1903 07:36:05.190
803 25-AUG-1929 15:43:49.831
804 29-SEP-1941 04:25:09.013
805 19-APR-1943 06:49:27.524
806 07-OCT-1943 02:57:52.016
807 17-MAR-1992 16:45:44.865
808 25-FEB-1996 21:30:57.820
809 29-SEP-1941 04:25:09.154
810 19-APR-1943 06:49:27.105
811 07-OCT-1943 02:57:52.482
812 17-MAR-1992 16:45:44.658
813 25-FEB-1996 21:30:57.582
814 10-NOV-2038 22:30:04.183
815 18-JUL-2094 01:56:51.593
817 AT_CHECK([cat datetime25.4.out], [0], [dnl
818 10-JUN-1648 00:00:00.0000
819 30-JUN-1680 04:50:38.1230
820 24-JUL-1716 12:31:35.2345
821 19-JUN-1768 12:47:53.3450
822 02-AUG-1819 01:26:00.4562
823 27-MAR-1839 20:58:11.5668
824 19-APR-1903 07:36:05.1896
825 25-AUG-1929 15:43:49.8313
826 29-SEP-1941 04:25:09.0129
827 19-APR-1943 06:49:27.5238
828 07-OCT-1943 02:57:52.0156
829 17-MAR-1992 16:45:44.8653
830 25-FEB-1996 21:30:57.8205
831 29-SEP-1941 04:25:09.1539
832 19-APR-1943 06:49:27.1053
833 07-OCT-1943 02:57:52.4823
834 17-MAR-1992 16:45:44.6583
835 25-FEB-1996 21:30:57.5822
836 10-NOV-2038 22:30:04.1835
837 18-JUL-2094 01:56:51.5932
839 AT_CHECK([cat datetime26.5.out], [0], [dnl
840 10-JUN-1648 00:00:00.00000
841 30-JUN-1680 04:50:38.12301
842 24-JUL-1716 12:31:35.23453
843 19-JUN-1768 12:47:53.34505
844 02-AUG-1819 01:26:00.45615
845 27-MAR-1839 20:58:11.56677
846 19-APR-1903 07:36:05.18964
847 25-AUG-1929 15:43:49.83132
848 29-SEP-1941 04:25:09.01293
849 19-APR-1943 06:49:27.52375
850 07-OCT-1943 02:57:52.01565
851 17-MAR-1992 16:45:44.86529
852 25-FEB-1996 21:30:57.82047
853 29-SEP-1941 04:25:09.15395
854 19-APR-1943 06:49:27.10533
855 07-OCT-1943 02:57:52.48229
856 17-MAR-1992 16:45:44.65827
857 25-FEB-1996 21:30:57.58219
858 10-NOV-2038 22:30:04.18347
859 18-JUL-2094 01:56:51.59319
863 AT_SETUP([output invalid dates])
864 AT_KEYWORDS([data-out])
865 AT_DATA([bad-date.sps], [dnl
868 data list list notable/x.
874 print outfile='bad-date.out'/x(date9) ' | ' x(date11).
875 print outfile='bad-date.out'/x(adate8) ' | ' x(adate10).
876 print outfile='bad-date.out'/x(edate8) ' | ' x(edate10).
877 print outfile='bad-date.out'/x(jdate5) ' | ' x(jdate7).
878 print outfile='bad-date.out'/x(sdate8) ' | ' x(sdate10).
879 print outfile='bad-date.out'/x(qyr6) ' | ' x(qyr8).
880 print outfile='bad-date.out'/x(moyr6) ' | ' x(moyr8).
881 print outfile='bad-date.out'/x(wkyr8) ' | ' x(wkyr10).
882 print outfile='bad-date.out'/x(datetime17).
883 print outfile='bad-date.out'/x(datetime18).
884 print outfile='bad-date.out'/x(datetime19).
885 print outfile='bad-date.out'/x(datetime20).
886 print outfile='bad-date.out'/x(datetime21).
887 print outfile='bad-date.out'/x(datetime22).
888 print outfile='bad-date.out'/x(datetime22.1).
889 print outfile='bad-date.out'/x(datetime23.2).
890 print outfile='bad-date.out'/x(datetime24.3).
891 print outfile='bad-date.out'/x(datetime25.4).
892 print outfile='bad-date.out'/x(datetime26.5).
895 AT_CHECK([pspp -O format=csv bad-date.sps])
896 AT_CHECK([cat bad-date.out], [0], [dnl
935 ********* | ***********
936 ******** | **********
937 ******** | **********
939 ******** | **********
942 ******** | **********
949 28-MAY-**** 05:20:00.0
950 28-MAY-**** 05:20:00.00
951 28-MAY-**** 05:20:00.000
952 28-MAY-**** 05:20:00.0000
953 28-MAY-**** 05:20:00.00000
957 AT_SETUP([time output])
958 AT_KEYWORDS([data-out])
959 AT_DATA([time-out.sps], [dnl
961 data list notable /x 1-30 (dtime).
1164 print outfile='time5.out'/x(time5).
1165 print outfile='time6.out'/x(time6).
1166 print outfile='time7.out'/x(time7).
1167 print outfile='time8.out'/x(time8).
1168 print outfile='time9.out'/x(time9).
1169 print outfile='time10.out'/x(time10).
1170 print outfile='time10.1.out'/x(time10.1).
1171 print outfile='time11.out'/x(time11).
1172 print outfile='time11.1.out'/x(time11.1).
1173 print outfile='time11.2.out'/x(time11.2).
1174 print outfile='time12.out'/x(time12).
1175 print outfile='time12.1.out'/x(time12.1).
1176 print outfile='time12.2.out'/x(time12.2).
1177 print outfile='time12.3.out'/x(time12.3).
1178 print outfile='time13.out'/x(time13).
1179 print outfile='time13.1.out'/x(time13.1).
1180 print outfile='time13.2.out'/x(time13.2).
1181 print outfile='time13.3.out'/x(time13.3).
1182 print outfile='time13.4.out'/x(time13.4).
1183 print outfile='time14.out'/x(time14).
1184 print outfile='time14.1.out'/x(time14.1).
1185 print outfile='time14.2.out'/x(time14.2).
1186 print outfile='time14.3.out'/x(time14.3).
1187 print outfile='time14.4.out'/x(time14.4).
1188 print outfile='time14.5.out'/x(time14.5).
1189 print outfile='time15.out'/x(time15).
1190 print outfile='time15.1.out'/x(time15.1).
1191 print outfile='time15.2.out'/x(time15.2).
1192 print outfile='time15.3.out'/x(time15.3).
1193 print outfile='time15.4.out'/x(time15.4).
1194 print outfile='time15.5.out'/x(time15.5).
1195 print outfile='time15.6.out'/x(time15.6).
1196 print outfile='dtime8.out'/x(dtime8).
1197 print outfile='dtime9.out'/x(dtime9).
1198 print outfile='dtime10.out'/x(dtime10).
1199 print outfile='dtime11.out'/x(dtime11).
1200 print outfile='dtime12.out'/x(dtime12).
1201 print outfile='dtime13.out'/x(dtime13).
1202 print outfile='dtime13.1.out'/x(dtime13.1).
1203 print outfile='dtime14.out'/x(dtime14).
1204 print outfile='dtime14.1.out'/x(dtime14.1).
1205 print outfile='dtime14.2.out'/x(dtime14.2).
1206 print outfile='dtime15.out'/x(dtime15).
1207 print outfile='dtime15.1.out'/x(dtime15.1).
1208 print outfile='dtime15.2.out'/x(dtime15.2).
1209 print outfile='dtime15.3.out'/x(dtime15.3).
1210 print outfile='dtime16.out'/x(dtime16).
1211 print outfile='dtime16.1.out'/x(dtime16.1).
1212 print outfile='dtime16.2.out'/x(dtime16.2).
1213 print outfile='dtime16.3.out'/x(dtime16.3).
1214 print outfile='dtime16.4.out'/x(dtime16.4).
1215 print outfile='dtime17.out'/x(dtime17).
1216 print outfile='dtime17.1.out'/x(dtime17.1).
1217 print outfile='dtime17.2.out'/x(dtime17.2).
1218 print outfile='dtime17.3.out'/x(dtime17.3).
1219 print outfile='dtime17.4.out'/x(dtime17.4).
1220 print outfile='dtime17.5.out'/x(dtime17.5).
1221 print outfile='dtime18.out'/x(dtime18).
1222 print outfile='dtime18.1.out'/x(dtime18.1).
1223 print outfile='dtime18.2.out'/x(dtime18.2).
1224 print outfile='dtime18.3.out'/x(dtime18.3).
1225 print outfile='dtime18.4.out'/x(dtime18.4).
1226 print outfile='dtime18.5.out'/x(dtime18.5).
1227 print outfile='dtime18.6.out'/x(dtime18.6).
1230 AT_CHECK([pspp -O format=csv time-out.sps])
1231 AT_CHECK([cat time5.out], [0], [dnl
1433 AT_CHECK([cat time6.out], [0], [dnl
1635 AT_CHECK([cat time7.out], [0], [dnl
1837 AT_CHECK([cat time8.out], [0], [dnl
2039 AT_CHECK([cat time9.out], [0], [dnl
2241 AT_CHECK([cat time10.out], [0], [dnl
2443 AT_CHECK([cat time10.1.out], [0], [dnl
2645 AT_CHECK([cat time11.out], [0], [dnl
2847 AT_CHECK([cat time11.1.out], [0], [dnl
3049 AT_CHECK([cat time11.2.out], [0], [dnl
3251 AT_CHECK([cat time12.out], [0], [dnl
3453 AT_CHECK([cat time12.1.out], [0], [dnl
3655 AT_CHECK([cat time12.2.out], [0], [dnl
3857 AT_CHECK([cat time12.3.out], [0], [dnl
4059 AT_CHECK([cat time13.out], [0], [dnl
4261 AT_CHECK([cat time13.1.out], [0], [dnl
4463 AT_CHECK([cat time13.2.out], [0], [dnl
4665 AT_CHECK([cat time13.3.out], [0], [dnl
4867 AT_CHECK([cat time13.4.out], [0], [dnl
5069 AT_CHECK([cat time14.out], [0], [dnl
5271 AT_CHECK([cat time14.1.out], [0], [dnl
5473 AT_CHECK([cat time14.2.out], [0], [dnl
5675 AT_CHECK([cat time14.3.out], [0], [dnl
5877 AT_CHECK([cat time14.4.out], [0], [dnl
6079 AT_CHECK([cat time14.5.out], [0], [dnl
6281 AT_CHECK([cat time15.out], [0], [dnl
6483 AT_CHECK([cat time15.1.out], [0], [dnl
6685 AT_CHECK([cat time15.2.out], [0], [dnl
6887 AT_CHECK([cat time15.3.out], [0], [dnl
7089 AT_CHECK([cat time15.4.out], [0], [dnl
7291 AT_CHECK([cat time15.5.out], [0], [dnl
7493 AT_CHECK([cat time15.6.out], [0], [dnl
7695 AT_CHECK([cat dtime8.out], [0], [dnl
7897 AT_CHECK([cat dtime9.out], [0], [dnl
8099 AT_CHECK([cat dtime10.out], [0], [dnl
8301 AT_CHECK([cat dtime11.out], [0], [dnl
8503 AT_CHECK([cat dtime12.out], [0], [dnl
8705 AT_CHECK([cat dtime13.out], [0], [dnl
8907 AT_CHECK([cat dtime13.1.out], [0], [dnl
9109 AT_CHECK([cat dtime14.out], [0], [dnl
9311 AT_CHECK([cat dtime14.1.out], [0], [dnl
9513 AT_CHECK([cat dtime14.2.out], [0], [dnl
9715 AT_CHECK([cat dtime15.out], [0], [dnl
9917 AT_CHECK([cat dtime15.1.out], [0], [dnl
10119 AT_CHECK([cat dtime15.2.out], [0], [dnl
10321 AT_CHECK([cat dtime15.3.out], [0], [dnl
10523 AT_CHECK([cat dtime16.out], [0], [dnl
10725 AT_CHECK([cat dtime16.1.out], [0], [dnl
10927 AT_CHECK([cat dtime16.2.out], [0], [dnl
11129 AT_CHECK([cat dtime16.3.out], [0], [dnl
11331 AT_CHECK([cat dtime16.4.out], [0], [dnl
11533 AT_CHECK([cat dtime17.out], [0], [dnl
11735 AT_CHECK([cat dtime17.1.out], [0], [dnl
11937 AT_CHECK([cat dtime17.2.out], [0], [dnl
12139 AT_CHECK([cat dtime17.3.out], [0], [dnl
12341 AT_CHECK([cat dtime17.4.out], [0], [dnl
12543 AT_CHECK([cat dtime17.5.out], [0], [dnl
12745 AT_CHECK([cat dtime18.out], [0], [dnl
12947 AT_CHECK([cat dtime18.1.out], [0], [dnl
13149 AT_CHECK([cat dtime18.2.out], [0], [dnl
13351 AT_CHECK([cat dtime18.3.out], [0], [dnl
13553 AT_CHECK([cat dtime18.4.out], [0], [dnl
13755 AT_CHECK([cat dtime18.5.out], [0], [dnl
13957 AT_CHECK([cat dtime18.6.out], [0], [dnl
14161 AT_SETUP([MONTH output])
14162 AT_KEYWORDS([data-out])
14163 AT_DATA([month-out.sps], [dnl
14165 set mxwarns=10000000.
14166 data list notable/x 1-10.
14192 print outfile='month-out.out'/x(month3).
14193 print outfile='month-out.out'/x(month4).
14194 print outfile='month-out.out'/x(month5).
14195 print outfile='month-out.out'/x(month6).
14196 print outfile='month-out.out'/x(month7).
14197 print outfile='month-out.out'/x(month8).
14198 print outfile='month-out.out'/x(month9).
14199 print outfile='month-out.out'/x(month10).
14200 print outfile='month-out.out'/x(month11).
14201 print outfile='month-out.out'/x(month12).
14202 print outfile='month-out.out'/x(month13).
14203 print outfile='month-out.out'/x(month14).
14204 print outfile='month-out.out'/x(month15).
14205 print outfile='month-out.out'/x(month16).
14206 print outfile='month-out.out'/x(month17).
14207 print outfile='month-out.out'/x(month18).
14208 print outfile='month-out.out'/x(month19).
14209 print outfile='month-out.out'/x(month20).
14210 print outfile='month-out.out'/x(month21).
14211 print outfile='month-out.out'/x(month22).
14212 print outfile='month-out.out'/x(month23).
14213 print outfile='month-out.out'/x(month24).
14214 print outfile='month-out.out'/x(month25).
14215 print outfile='month-out.out'/x(month26).
14216 print outfile='month-out.out'/x(month27).
14217 print outfile='month-out.out'/x(month28).
14218 print outfile='month-out.out'/x(month29).
14219 print outfile='month-out.out'/x(month30).
14220 print outfile='month-out.out'/x(month31).
14221 print outfile='month-out.out'/x(month32).
14222 print outfile='month-out.out'/x(month33).
14223 print outfile='month-out.out'/x(month34).
14224 print outfile='month-out.out'/x(month35).
14225 print outfile='month-out.out'/x(month36).
14226 print outfile='month-out.out'/x(month37).
14227 print outfile='month-out.out'/x(month38).
14228 print outfile='month-out.out'/x(month39).
14229 print outfile='month-out.out'/x(month40).
14232 AT_CHECK([pspp -O format=csv month-out.sps], [1], [stdout])
14233 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
14235 38 error: Month number 0.000000 is not between 1 and 12.
14236 38 error: Month number 0.500000 is not between 1 and 12.
14237 38 error: Month number 0.900000 is not between 1 and 12.
14238 38 error: Month number 13.000000 is not between 1 and 12.
14240 AT_CHECK([cat month-out.out], [0], [dnl
15118 AT_SETUP([WKDAY output])
15119 AT_KEYWORDS([data-out])
15120 AT_DATA([wkday-out.sps], [dnl
15121 set mxwarns=10000000.
15122 set mxerrs=10000000.
15123 data list notable/x 1-10.
15144 do repeat format=wkday2 to wkday40.
15145 print outfile='wkday-out.out'/x(format).
15149 AT_CHECK([pspp -O format=csv wkday-out.sps], [1], [stdout])
15150 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
15152 39 error: Weekday number 0.000000 is not between 1 and 7.
15153 39 error: Weekday number 0.500000 is not between 1 and 7.
15154 39 error: Weekday number 0.900000 is not between 1 and 7.
15155 39 error: Weekday number 8.000000 is not between 1 and 7.
15157 AT_CHECK([cat wkday-out.out], [0], [dnl
15863 dnl This checks for a regression where AHEX output would crash due to
15864 dnl dereferencing string data as a pointer, for string widths between
15865 dnl 5 and 8, inclusive.
15866 AT_SETUP([AHEX output bug])
15867 AT_KEYWORDS([data-out])
15868 AT_DATA([ahex.sps], [
15869 DATA LIST NOTABLE /s (a8).
15873 FORMATS s (AHEX16).
15876 AT_CHECK([pspp -O format=csv ahex.sps], [0], [dnl