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])
24 SET CCB='-,[[[,]]],-'.
31 values = """0 2 9.5 27 271 999.95 2718 9999.995 27182 271828
32 2718281 2**39 2**333 2**-21 -2 -9.5 -27 -271 -999.95 -2718 -9999.995
33 -27182 -271828 -2718281 -2**39 -2**333 -2**-21 -0 3.125 31.25 314.125
34 3141.5 31415.875 314159.25 3141592.625 31415926.5 271828182.25
35 3214567890.5 31415926535.875 -3.125 -31.375 -314.125 -3141.5
36 -31415.875 -314159.25 -3141592.625 -31415926.5 -271828182.25
37 -3214567890.5 -31415926535.875""".split()
39 print("""COMPUTE NUM=%s.
41 END CASE.""" % (value, value))
45 END INPUT PROGRAM.""")
47 print("PRINT OUTFILE='output.txt'/EXPR.")
48 for format in 'F COMMA DOT DOLLAR PCT E CCA CCB CCC CCD CCE N Z'.split():
52 if format in ('DOLLAR', 'PCT'):
54 if min_w == 1 and format.startswith('CC'):
59 for w in range(min_w, 41):
60 f = "%s%s.%s" % (format, w, d)
61 print("PRINT OUTFILE='output.txt'/'%s: \"' NUM(%s) '\"'." % (f, f))
62 print("PRINT SPACE OUTFILE='output.txt'.")
65 AT_CHECK([$PYTHON3 num-out.py > num-out.sps])
66 AT_CHECK([pspp -O format=csv num-out.sps])
67 AT_CHECK([inexactify < output.txt > output.inexact])
68 AT_CHECK([gzip -cd < $top_srcdir/tests/data/num-out.expected.cmp.gz > expout.cmp])
69 AT_DATA([num-out-decmp.py],
76 for line in sys.stdin:
77 line = line.rstrip('\r\n')
78 if line.startswith('*'):
81 state[1] = "%s" % (int(state[1]) + 1)
82 state[3] = ' ' + state[3]
83 print(' ' + ''.join(state))
84 elif line.startswith('$'):
86 state[1] = "%s" % (int(state[1]) + 1)
88 print(' ' + ''.join(state))
89 elif line.startswith('^'):
91 state[1] = "%s" % (int(state[1]) + 1)
92 state[4] = c + state[4]
93 print(' ' + ''.join(state))
95 m = re.match(r'^([A-Z]+)(\d+)([^"]+")( *)([^%"]*)(%?")$', line)
97 state = list(m.groups())
100 AT_CHECK([$PYTHON3 num-out-decmp.py < expout.cmp > expout.exact])
101 AT_CHECK([[inexactify < expout.exact > expout.inexact]])
102 AT_DATA([num-out-compare.py],
103 [[#! /usr/bin/python3
112 %s: compare expected and actual numeric formatting output
113 usage: %s [OPTION...] EXPECTED ACTUAL
114 where EXPECTED is the file containing expected output
115 and ACTUAL is the file containing actual output.
117 -e, --exact: Require numbers to be exactly equal.
118 (By default, small differences are permitted.)
119 -s, --spss: Ignore most SPSS formatting bugs in EXPECTED.
120 (A few differences are not compensated)
121 -v, --verbose: Use once to summarize errors and differences.
122 Use twice for details of differences."""
123 % (sys.argv[0], sys.argv[0]))
130 options, args = getopt.gnu_getopt(sys.argv[1:], 'esvh',
131 ['exact', 'spss', 'verbose', 'help'])
132 for key, value in options:
133 if key in ['-e', '--exact']:
135 elif key in ['-s', '--spss']:
137 elif key in ['-v', '--verbose']:
139 elif key in ['-h', '--help']:
144 sys.stderr.write("%s\n" % len(args))
145 sys.stderr.write("exactly two nonoption arguments are required "
146 "(use --help for help)\n")
150 """Returns 'n' incremented by one unit in its final decimal place.
154 for i, c in enumerate(n):
159 if last_digit is None:
162 for i in range(last_digit, -1, -1):
166 elif c in '012345678':
167 n[i] = chr(ord(c) + 1)
181 for a, b in itertools.zip_longest(open(args[0], 'r'),
185 print("Extra lines in %s" % args[0])
189 print("Extra lines in %s" % args[1])
197 if not a.isspace() and ':' not in a:
200 fmt, a_out = re.match(r'^ (.*): "(.*)"$', a).groups()
201 b_fmt, b_out = re.match(r'^ (.*): "(.*)"$', b).groups()
203 assert a_out != b_out
206 if increment(a_out) == b_out or increment(b_out) == a_out:
210 if re.search(r'0.*0', a_out) and not re.search(r'[1-9]', a_out):
213 elif '*' in a_out and len(a_out.strip('*')):
216 elif (expr.startswith('-')
217 and re.fullmatch(r'\*+', a_out)
218 and re.match(r'-\d(\.\d*#*)?E[-+]\d\d\d', b_out)
219 and fmt.startswith('E')):
222 elif (expr.startswith('-')
223 and (('-' not in a_out
224 and re.search(r'[1-9]', a_out)
227 and re.fullmatch(r'\*+', b_out)))):
232 print('%s: %s in %s: expected "%s", got "%s'
233 % (line_number, expr, fmt, a_out, b_out))
236 print("%s exact matches" % n_exact)
237 print("%s errors" % errors)
239 print('%s approximate matches' %approximate)
241 print("%s bad rounds" % bad_round)
242 print("%s SPSS WTF 1" % spss_wtf1)
243 print("%s SPSS WTF 2" % spss_wtf2)
244 print("%s lost signs" % lost_sign)
245 sys.exit(1 if errors else 0)
247 AT_CHECK([$PYTHON3 num-out-compare.py $PSPP_NUM_OUT_COMPARE_FLAGS expout.inexact output.inexact])
250 AT_SETUP([leading zeros in numeric output])
251 AT_KEYWORDS([data-out LEADZERO])
252 AT_DATA([data-out.sps], [dnl
253 DATA LIST LIST NOTABLE/x.
265 PRINT/x (F5.2) x (F5.1).
269 PRINT/x (F5.2) x (F5.1).
272 AT_CHECK([pspp -O format=csv data-out.sps], [0], [dnl
293 AT_SETUP([non-ASCII custom currency formats])
294 AT_KEYWORDS([data-out])
295 AT_DATA([data-out.sps], [dnl
298 DATA LIST LIST NOTABLE/x.
299 PRINT/x (F8.2) x (CCA10.2).
311 AT_CHECK([pspp -O format=csv data-out.sps], [0], [dnl
325 1.5E+010 ¥2E+010€ @&t@
331 AT_SETUP([binary and hexadecimal output])
332 AT_KEYWORDS([data-out])
333 AT_DATA([binhex-out.sps], [dnl
335 SET MXWARNS=10000000.
337 DATA LIST NOTABLE/x 1-10.
408 FILE HANDLE output/NAME='binhex.out'/MODE=IMAGE/LRECL=256.
409 WRITE OUTFILE=output/
410 x(p1.0) x(p2.0) x(p3.0) x(p4.0) /* 000
411 x(p2.1) x(p3.1) x(p4.1) /* 00a
412 x(p3.2) x(p4.2) /* 013
414 x(pk1.0) x(pk2.0) x(pk3.0) x(pk4.0) /* 01e
415 x(pk2.1) x(pk3.1) x(pk4.1) /* 028
416 x(pk3.2) x(pk4.2) /* 031
418 x(ib1.0) x(ib2.0) x(ib3.0) x(ib4.0) /* 03c
419 x(ib1.1) x(ib2.1) x(ib3.1) x(ib4.1) /* 046
420 x(ib1.2) x(ib2.2) x(ib3.2) x(ib4.2) /* 050
421 x(ib1.3) x(ib2.3) x(ib3.3) x(ib4.3) /* 05a
422 x(ib2.4) x(ib3.4) x(ib4.4) /* 064
423 x(ib2.5) x(ib3.5) x(ib4.5) /* 06d
424 x(ib3.6) x(ib4.6) /* 076
425 x(ib3.7) x(ib4.7) /* 07d
426 x(ib3.8) x(ib4.8) /* 084
429 x(pib1.0) x(pib2.0) x(pib3.0) x(pib4.0) /* 093
430 x(pib1.1) x(pib2.1) x(pib3.1) x(pib4.1) /* 09d
431 x(pib1.2) x(pib2.2) x(pib3.2) x(pib4.2) /* 0a7
432 x(pib1.3) x(pib2.3) x(pib3.3) x(pib4.3) /* 0b1
433 x(pib2.4) x(pib3.4) x(pib4.4) /* 0bb
434 x(pib2.5) x(pib3.5) x(pib4.5) /* 0c4
435 x(pib3.6) x(pib4.6) /* 0cd
436 x(pib3.7) x(pib4.7) /* 0d4
437 x(pib3.8) x(pib4.8) /* 0db
440 x(pibhex2) x(pibhex4) /* 0ea
441 x(pibhex6) x(pibhex8). /* 0f0
445 AT_CHECK([pspp -O format=csv binhex-out.sps])
446 AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-out.expected.gz > expout])
447 AT_CHECK([cat binhex.out], [0], [expout])
450 AT_SETUP([output valid dates])
451 AT_KEYWORDS([data-out])
452 AT_DATA([date-out.sps], [dnl
454 data list notable /x 1-30 (datetime).
457 30-6-1680 4:50:38.12301
458 24-7-1716 12:31:35.23453
459 19-6-1768 12:47:53.34505
460 2-8-1819 1:26:0.45615
461 27-3-1839 20:58:11.56677
462 19-4-1903 7:36:5.18964
463 25-8-1929 15:43:49.83132
464 29-9-1941 4:25:9.01293
465 19-4-1943 6:49:27.52375
466 7-10-1943 2:57:52.01565
467 17-3-1992 16:45:44.86529
468 25-2-1996 21:30:57.82047
470 19-4-43 6:49:27.10533
471 7-10-43 2:57:52.48229
472 17-3-92 16:45:44.65827
473 25-2-96 21:30:57.58219
474 10-11-2038 22:30:4.18347
475 18-7-2094 1:56:51.59319
477 print outfile='date.out'/x(date9) ' | ' x(date11).
478 print outfile='adate.out'/x(adate8) ' | ' x(adate10).
479 print outfile='edate.out'/x(edate8) ' | ' x(edate10).
480 print outfile='jdate.out'/x(jdate5) ' | ' x(jdate7).
481 print outfile='sdate.out'/x(sdate8) ' | ' x(sdate10).
482 print outfile='qyr.out'/x(qyr6) ' | ' x(qyr8).
483 print outfile='moyr.out'/x(moyr6) ' | ' x(moyr8).
484 print outfile='wkyr.out'/x(wkyr8) ' | ' x(wkyr10).
485 print outfile='datetime17.out'/x(datetime17).
486 print outfile='datetime18.out'/x(datetime18).
487 print outfile='datetime19.out'/x(datetime19).
488 print outfile='datetime20.out'/x(datetime20).
489 print outfile='datetime21.out'/x(datetime21).
490 print outfile='datetime22.out'/x(datetime22).
491 print outfile='datetime22.1.out'/x(datetime22.1).
492 print outfile='datetime23.2.out'/x(datetime23.2).
493 print outfile='datetime24.3.out'/x(datetime24.3).
494 print outfile='datetime25.4.out'/x(datetime25.4).
495 print outfile='datetime26.5.out'/x(datetime26.5).
496 print outfile='ymdhms16.out'/x(ymdhms16).
497 print outfile='ymdhms17.out'/x(ymdhms17).
498 print outfile='ymdhms18.out'/x(ymdhms18).
499 print outfile='ymdhms19.out'/x(ymdhms19).
500 print outfile='ymdhms20.out'/x(ymdhms20).
501 print outfile='ymdhms21.out'/x(ymdhms21).
502 print outfile='ymdhms21.1.out'/x(ymdhms21.1).
503 print outfile='ymdhms22.2.out'/x(ymdhms22.2).
504 print outfile='ymdhms23.3.out'/x(ymdhms23.3).
505 print outfile='ymdhms24.4.out'/x(ymdhms24.4).
506 print outfile='ymdhms25.5.out'/x(ymdhms25.5).
509 AT_CHECK([pspp -O format=csv date-out.sps])
510 AT_CHECK([cat date.out], [0], [dnl
511 ********* | 10-JUN-1648
512 ********* | 30-JUN-1680
513 ********* | 24-JUL-1716
514 ********* | 19-JUN-1768
515 ********* | 02-AUG-1819
516 ********* | 27-MAR-1839
517 ********* | 19-APR-1903
518 ********* | 25-AUG-1929
519 29-SEP-41 | 29-SEP-1941
520 19-APR-43 | 19-APR-1943
521 07-OCT-43 | 07-OCT-1943
522 17-MAR-92 | 17-MAR-1992
523 25-FEB-96 | 25-FEB-1996
524 29-SEP-41 | 29-SEP-1941
525 19-APR-43 | 19-APR-1943
526 07-OCT-43 | 07-OCT-1943
527 17-MAR-92 | 17-MAR-1992
528 25-FEB-96 | 25-FEB-1996
529 ********* | 10-NOV-2038
530 ********* | 18-JUL-2094
532 AT_CHECK([cat adate.out], [0], [dnl
533 ******** | 06/10/1648
534 ******** | 06/30/1680
535 ******** | 07/24/1716
536 ******** | 06/19/1768
537 ******** | 08/02/1819
538 ******** | 03/27/1839
539 ******** | 04/19/1903
540 ******** | 08/25/1929
541 09/29/41 | 09/29/1941
542 04/19/43 | 04/19/1943
543 10/07/43 | 10/07/1943
544 03/17/92 | 03/17/1992
545 02/25/96 | 02/25/1996
546 09/29/41 | 09/29/1941
547 04/19/43 | 04/19/1943
548 10/07/43 | 10/07/1943
549 03/17/92 | 03/17/1992
550 02/25/96 | 02/25/1996
551 ******** | 11/10/2038
552 ******** | 07/18/2094
554 AT_CHECK([cat edate.out], [0], [dnl
555 ******** | 10.06.1648
556 ******** | 30.06.1680
557 ******** | 24.07.1716
558 ******** | 19.06.1768
559 ******** | 02.08.1819
560 ******** | 27.03.1839
561 ******** | 19.04.1903
562 ******** | 25.08.1929
563 29.09.41 | 29.09.1941
564 19.04.43 | 19.04.1943
565 07.10.43 | 07.10.1943
566 17.03.92 | 17.03.1992
567 25.02.96 | 25.02.1996
568 29.09.41 | 29.09.1941
569 19.04.43 | 19.04.1943
570 07.10.43 | 07.10.1943
571 17.03.92 | 17.03.1992
572 25.02.96 | 25.02.1996
573 ******** | 10.11.2038
574 ******** | 18.07.2094
576 AT_CHECK([cat jdate.out], [0], [dnl
598 AT_CHECK([cat sdate.out], [0], [dnl
599 ******** | 1648/06/10
600 ******** | 1680/06/30
601 ******** | 1716/07/24
602 ******** | 1768/06/19
603 ******** | 1819/08/02
604 ******** | 1839/03/27
605 ******** | 1903/04/19
606 ******** | 1929/08/25
607 41/09/29 | 1941/09/29
608 43/04/19 | 1943/04/19
609 43/10/07 | 1943/10/07
610 92/03/17 | 1992/03/17
611 96/02/25 | 1996/02/25
612 41/09/29 | 1941/09/29
613 43/04/19 | 1943/04/19
614 43/10/07 | 1943/10/07
615 92/03/17 | 1992/03/17
616 96/02/25 | 1996/02/25
617 ******** | 2038/11/10
618 ******** | 2094/07/18
620 AT_CHECK([cat qyr.out], [0], [dnl
642 AT_CHECK([cat moyr.out], [0], [dnl
664 AT_CHECK([cat wkyr.out], [0], [dnl
665 ******** | 24 WK 1648
666 ******** | 26 WK 1680
667 ******** | 30 WK 1716
668 ******** | 25 WK 1768
669 ******** | 31 WK 1819
670 ******** | 13 WK 1839
671 ******** | 16 WK 1903
672 ******** | 34 WK 1929
673 39 WK 41 | 39 WK 1941
674 16 WK 43 | 16 WK 1943
675 40 WK 43 | 40 WK 1943
676 11 WK 92 | 11 WK 1992
678 39 WK 41 | 39 WK 1941
679 16 WK 43 | 16 WK 1943
680 40 WK 43 | 40 WK 1943
681 11 WK 92 | 11 WK 1992
683 ******** | 45 WK 2038
684 ******** | 29 WK 2094
686 AT_CHECK([cat datetime17.out], [0], [dnl
708 AT_CHECK([cat datetime18.out], [0], [dnl
730 AT_CHECK([cat datetime19.out], [0], [dnl
752 AT_CHECK([cat datetime20.out], [0], [dnl
774 AT_CHECK([cat datetime21.out], [0], [dnl
796 AT_CHECK([cat datetime22.out], [0], [dnl
818 AT_CHECK([cat datetime22.1.out], [0], [dnl
819 10-JUN-1648 00:00:00.0
820 30-JUN-1680 04:50:38.1
821 24-JUL-1716 12:31:35.2
822 19-JUN-1768 12:47:53.3
823 02-AUG-1819 01:26:00.5
824 27-MAR-1839 20:58:11.6
825 19-APR-1903 07:36:05.2
826 25-AUG-1929 15:43:49.8
827 29-SEP-1941 04:25:09.0
828 19-APR-1943 06:49:27.5
829 07-OCT-1943 02:57:52.0
830 17-MAR-1992 16:45:44.9
831 25-FEB-1996 21:30:57.8
832 29-SEP-1941 04:25:09.2
833 19-APR-1943 06:49:27.1
834 07-OCT-1943 02:57:52.5
835 17-MAR-1992 16:45:44.7
836 25-FEB-1996 21:30:57.6
837 10-NOV-2038 22:30:04.2
838 18-JUL-2094 01:56:51.6
840 AT_CHECK([cat datetime23.2.out], [0], [dnl
841 10-JUN-1648 00:00:00.00
842 30-JUN-1680 04:50:38.12
843 24-JUL-1716 12:31:35.23
844 19-JUN-1768 12:47:53.35
845 02-AUG-1819 01:26:00.46
846 27-MAR-1839 20:58:11.57
847 19-APR-1903 07:36:05.19
848 25-AUG-1929 15:43:49.83
849 29-SEP-1941 04:25:09.01
850 19-APR-1943 06:49:27.52
851 07-OCT-1943 02:57:52.02
852 17-MAR-1992 16:45:44.87
853 25-FEB-1996 21:30:57.82
854 29-SEP-1941 04:25:09.15
855 19-APR-1943 06:49:27.11
856 07-OCT-1943 02:57:52.48
857 17-MAR-1992 16:45:44.66
858 25-FEB-1996 21:30:57.58
859 10-NOV-2038 22:30:04.18
860 18-JUL-2094 01:56:51.59
862 AT_CHECK([cat datetime24.3.out], [0], [dnl
863 10-JUN-1648 00:00:00.000
864 30-JUN-1680 04:50:38.123
865 24-JUL-1716 12:31:35.235
866 19-JUN-1768 12:47:53.345
867 02-AUG-1819 01:26:00.456
868 27-MAR-1839 20:58:11.567
869 19-APR-1903 07:36:05.190
870 25-AUG-1929 15:43:49.831
871 29-SEP-1941 04:25:09.013
872 19-APR-1943 06:49:27.524
873 07-OCT-1943 02:57:52.016
874 17-MAR-1992 16:45:44.865
875 25-FEB-1996 21:30:57.820
876 29-SEP-1941 04:25:09.154
877 19-APR-1943 06:49:27.105
878 07-OCT-1943 02:57:52.482
879 17-MAR-1992 16:45:44.658
880 25-FEB-1996 21:30:57.582
881 10-NOV-2038 22:30:04.183
882 18-JUL-2094 01:56:51.593
884 AT_CHECK([cat datetime25.4.out], [0], [dnl
885 10-JUN-1648 00:00:00.0000
886 30-JUN-1680 04:50:38.1230
887 24-JUL-1716 12:31:35.2345
888 19-JUN-1768 12:47:53.3450
889 02-AUG-1819 01:26:00.4562
890 27-MAR-1839 20:58:11.5668
891 19-APR-1903 07:36:05.1896
892 25-AUG-1929 15:43:49.8313
893 29-SEP-1941 04:25:09.0129
894 19-APR-1943 06:49:27.5238
895 07-OCT-1943 02:57:52.0156
896 17-MAR-1992 16:45:44.8653
897 25-FEB-1996 21:30:57.8205
898 29-SEP-1941 04:25:09.1539
899 19-APR-1943 06:49:27.1053
900 07-OCT-1943 02:57:52.4823
901 17-MAR-1992 16:45:44.6583
902 25-FEB-1996 21:30:57.5822
903 10-NOV-2038 22:30:04.1835
904 18-JUL-2094 01:56:51.5932
906 AT_CHECK([cat datetime26.5.out], [0], [dnl
907 10-JUN-1648 00:00:00.00000
908 30-JUN-1680 04:50:38.12301
909 24-JUL-1716 12:31:35.23453
910 19-JUN-1768 12:47:53.34505
911 02-AUG-1819 01:26:00.45615
912 27-MAR-1839 20:58:11.56677
913 19-APR-1903 07:36:05.18964
914 25-AUG-1929 15:43:49.83132
915 29-SEP-1941 04:25:09.01293
916 19-APR-1943 06:49:27.52375
917 07-OCT-1943 02:57:52.01565
918 17-MAR-1992 16:45:44.86529
919 25-FEB-1996 21:30:57.82047
920 29-SEP-1941 04:25:09.15395
921 19-APR-1943 06:49:27.10533
922 07-OCT-1943 02:57:52.48229
923 17-MAR-1992 16:45:44.65827
924 25-FEB-1996 21:30:57.58219
925 10-NOV-2038 22:30:04.18347
926 18-JUL-2094 01:56:51.59319
928 AT_CHECK([cat ymdhms16.out], [0], [dnl
950 AT_CHECK([cat ymdhms17.out], [0], [dnl
972 AT_CHECK([cat ymdhms18.out], [0], [dnl
994 AT_CHECK([cat ymdhms19.out], [0], [dnl
1016 AT_CHECK([cat ymdhms20.out], [0], [dnl
1038 AT_CHECK([cat ymdhms21.out], [0], [dnl
1060 AT_CHECK([cat ymdhms21.1.out], [0], [dnl
1061 1648-06-10 00:00:00.0
1062 1680-06-30 04:50:38.1
1063 1716-07-24 12:31:35.2
1064 1768-06-19 12:47:53.3
1065 1819-08-02 01:26:00.5
1066 1839-03-27 20:58:11.6
1067 1903-04-19 07:36:05.2
1068 1929-08-25 15:43:49.8
1069 1941-09-29 04:25:09.0
1070 1943-04-19 06:49:27.5
1071 1943-10-07 02:57:52.0
1072 1992-03-17 16:45:44.9
1073 1996-02-25 21:30:57.8
1074 1941-09-29 04:25:09.2
1075 1943-04-19 06:49:27.1
1076 1943-10-07 02:57:52.5
1077 1992-03-17 16:45:44.7
1078 1996-02-25 21:30:57.6
1079 2038-11-10 22:30:04.2
1080 2094-07-18 01:56:51.6
1082 AT_CHECK([cat ymdhms22.2.out], [0], [dnl
1083 1648-06-10 00:00:00.00
1084 1680-06-30 04:50:38.12
1085 1716-07-24 12:31:35.23
1086 1768-06-19 12:47:53.35
1087 1819-08-02 01:26:00.46
1088 1839-03-27 20:58:11.57
1089 1903-04-19 07:36:05.19
1090 1929-08-25 15:43:49.83
1091 1941-09-29 04:25:09.01
1092 1943-04-19 06:49:27.52
1093 1943-10-07 02:57:52.02
1094 1992-03-17 16:45:44.87
1095 1996-02-25 21:30:57.82
1096 1941-09-29 04:25:09.15
1097 1943-04-19 06:49:27.11
1098 1943-10-07 02:57:52.48
1099 1992-03-17 16:45:44.66
1100 1996-02-25 21:30:57.58
1101 2038-11-10 22:30:04.18
1102 2094-07-18 01:56:51.59
1104 AT_CHECK([cat ymdhms23.3.out], [0], [dnl
1105 1648-06-10 00:00:00.000
1106 1680-06-30 04:50:38.123
1107 1716-07-24 12:31:35.235
1108 1768-06-19 12:47:53.345
1109 1819-08-02 01:26:00.456
1110 1839-03-27 20:58:11.567
1111 1903-04-19 07:36:05.190
1112 1929-08-25 15:43:49.831
1113 1941-09-29 04:25:09.013
1114 1943-04-19 06:49:27.524
1115 1943-10-07 02:57:52.016
1116 1992-03-17 16:45:44.865
1117 1996-02-25 21:30:57.820
1118 1941-09-29 04:25:09.154
1119 1943-04-19 06:49:27.105
1120 1943-10-07 02:57:52.482
1121 1992-03-17 16:45:44.658
1122 1996-02-25 21:30:57.582
1123 2038-11-10 22:30:04.183
1124 2094-07-18 01:56:51.593
1126 AT_CHECK([cat ymdhms24.4.out], [0], [dnl
1127 1648-06-10 00:00:00.0000
1128 1680-06-30 04:50:38.1230
1129 1716-07-24 12:31:35.2345
1130 1768-06-19 12:47:53.3450
1131 1819-08-02 01:26:00.4562
1132 1839-03-27 20:58:11.5668
1133 1903-04-19 07:36:05.1896
1134 1929-08-25 15:43:49.8313
1135 1941-09-29 04:25:09.0129
1136 1943-04-19 06:49:27.5238
1137 1943-10-07 02:57:52.0156
1138 1992-03-17 16:45:44.8653
1139 1996-02-25 21:30:57.8205
1140 1941-09-29 04:25:09.1539
1141 1943-04-19 06:49:27.1053
1142 1943-10-07 02:57:52.4823
1143 1992-03-17 16:45:44.6583
1144 1996-02-25 21:30:57.5822
1145 2038-11-10 22:30:04.1835
1146 2094-07-18 01:56:51.5932
1148 AT_CHECK([cat ymdhms25.5.out], [0], [dnl
1149 1648-06-10 00:00:00.00000
1150 1680-06-30 04:50:38.12301
1151 1716-07-24 12:31:35.23453
1152 1768-06-19 12:47:53.34505
1153 1819-08-02 01:26:00.45615
1154 1839-03-27 20:58:11.56677
1155 1903-04-19 07:36:05.18964
1156 1929-08-25 15:43:49.83132
1157 1941-09-29 04:25:09.01293
1158 1943-04-19 06:49:27.52375
1159 1943-10-07 02:57:52.01565
1160 1992-03-17 16:45:44.86529
1161 1996-02-25 21:30:57.82047
1162 1941-09-29 04:25:09.15395
1163 1943-04-19 06:49:27.10533
1164 1943-10-07 02:57:52.48229
1165 1992-03-17 16:45:44.65827
1166 1996-02-25 21:30:57.58219
1167 2038-11-10 22:30:04.18347
1168 2094-07-18 01:56:51.59319
1172 AT_SETUP([output invalid dates])
1173 AT_KEYWORDS([data-out])
1174 AT_DATA([bad-date.sps], [dnl
1177 data list list notable/x.
1183 print outfile='bad-date.out'/x(date9) ' | ' x(date11).
1184 print outfile='bad-date.out'/x(adate8) ' | ' x(adate10).
1185 print outfile='bad-date.out'/x(edate8) ' | ' x(edate10).
1186 print outfile='bad-date.out'/x(jdate5) ' | ' x(jdate7).
1187 print outfile='bad-date.out'/x(sdate8) ' | ' x(sdate10).
1188 print outfile='bad-date.out'/x(qyr6) ' | ' x(qyr8).
1189 print outfile='bad-date.out'/x(moyr6) ' | ' x(moyr8).
1190 print outfile='bad-date.out'/x(wkyr8) ' | ' x(wkyr10).
1191 print outfile='bad-date.out'/x(datetime17).
1192 print outfile='bad-date.out'/x(datetime18).
1193 print outfile='bad-date.out'/x(datetime19).
1194 print outfile='bad-date.out'/x(datetime20).
1195 print outfile='bad-date.out'/x(datetime21).
1196 print outfile='bad-date.out'/x(datetime22).
1197 print outfile='bad-date.out'/x(datetime22.1).
1198 print outfile='bad-date.out'/x(datetime23.2).
1199 print outfile='bad-date.out'/x(datetime24.3).
1200 print outfile='bad-date.out'/x(datetime25.4).
1201 print outfile='bad-date.out'/x(datetime26.5).
1204 AT_CHECK([pspp -O format=csv bad-date.sps])
1205 AT_CHECK([cat bad-date.out], [0], [dnl
1244 ********* | ***********
1245 ******** | **********
1246 ******** | **********
1248 ******** | **********
1251 ******** | **********
1255 28-MAY-**** 05:20:00
1256 28-MAY-**** 05:20:00
1257 28-MAY-**** 05:20:00
1258 28-MAY-**** 05:20:00.0
1259 28-MAY-**** 05:20:00.00
1260 28-MAY-**** 05:20:00.000
1261 28-MAY-**** 05:20:00.0000
1262 28-MAY-**** 05:20:00.00000
1266 AT_SETUP([time output])
1267 AT_KEYWORDS([data-out])
1268 AT_DATA([time-out.sps], [dnl
1270 data list notable /x 1-30 (dtime).
1473 print outfile='time5.out'/x(time5).
1474 print outfile='time6.out'/x(time6).
1475 print outfile='time7.out'/x(time7).
1476 print outfile='time8.out'/x(time8).
1477 print outfile='time9.out'/x(time9).
1478 print outfile='time10.out'/x(time10).
1479 print outfile='time10.1.out'/x(time10.1).
1480 print outfile='time11.out'/x(time11).
1481 print outfile='time11.1.out'/x(time11.1).
1482 print outfile='time11.2.out'/x(time11.2).
1483 print outfile='time12.out'/x(time12).
1484 print outfile='time12.1.out'/x(time12.1).
1485 print outfile='time12.2.out'/x(time12.2).
1486 print outfile='time12.3.out'/x(time12.3).
1487 print outfile='time13.out'/x(time13).
1488 print outfile='time13.1.out'/x(time13.1).
1489 print outfile='time13.2.out'/x(time13.2).
1490 print outfile='time13.3.out'/x(time13.3).
1491 print outfile='time13.4.out'/x(time13.4).
1492 print outfile='time14.out'/x(time14).
1493 print outfile='time14.1.out'/x(time14.1).
1494 print outfile='time14.2.out'/x(time14.2).
1495 print outfile='time14.3.out'/x(time14.3).
1496 print outfile='time14.4.out'/x(time14.4).
1497 print outfile='time14.5.out'/x(time14.5).
1498 print outfile='time15.out'/x(time15).
1499 print outfile='time15.1.out'/x(time15.1).
1500 print outfile='time15.2.out'/x(time15.2).
1501 print outfile='time15.3.out'/x(time15.3).
1502 print outfile='time15.4.out'/x(time15.4).
1503 print outfile='time15.5.out'/x(time15.5).
1504 print outfile='time15.6.out'/x(time15.6).
1505 print outfile='dtime8.out'/x(dtime8).
1506 print outfile='dtime9.out'/x(dtime9).
1507 print outfile='dtime10.out'/x(dtime10).
1508 print outfile='dtime11.out'/x(dtime11).
1509 print outfile='dtime12.out'/x(dtime12).
1510 print outfile='dtime13.out'/x(dtime13).
1511 print outfile='dtime13.1.out'/x(dtime13.1).
1512 print outfile='dtime14.out'/x(dtime14).
1513 print outfile='dtime14.1.out'/x(dtime14.1).
1514 print outfile='dtime14.2.out'/x(dtime14.2).
1515 print outfile='dtime15.out'/x(dtime15).
1516 print outfile='dtime15.1.out'/x(dtime15.1).
1517 print outfile='dtime15.2.out'/x(dtime15.2).
1518 print outfile='dtime15.3.out'/x(dtime15.3).
1519 print outfile='dtime16.out'/x(dtime16).
1520 print outfile='dtime16.1.out'/x(dtime16.1).
1521 print outfile='dtime16.2.out'/x(dtime16.2).
1522 print outfile='dtime16.3.out'/x(dtime16.3).
1523 print outfile='dtime16.4.out'/x(dtime16.4).
1524 print outfile='dtime17.out'/x(dtime17).
1525 print outfile='dtime17.1.out'/x(dtime17.1).
1526 print outfile='dtime17.2.out'/x(dtime17.2).
1527 print outfile='dtime17.3.out'/x(dtime17.3).
1528 print outfile='dtime17.4.out'/x(dtime17.4).
1529 print outfile='dtime17.5.out'/x(dtime17.5).
1530 print outfile='dtime18.out'/x(dtime18).
1531 print outfile='dtime18.1.out'/x(dtime18.1).
1532 print outfile='dtime18.2.out'/x(dtime18.2).
1533 print outfile='dtime18.3.out'/x(dtime18.3).
1534 print outfile='dtime18.4.out'/x(dtime18.4).
1535 print outfile='dtime18.5.out'/x(dtime18.5).
1536 print outfile='dtime18.6.out'/x(dtime18.6).
1537 print outfile='mtime5.out'/x(mtime5).
1538 print outfile='mtime6.out'/x(mtime6).
1539 print outfile='mtime7.out'/x(mtime7).
1540 print outfile='mtime7.1.out'/x(mtime7.1).
1541 print outfile='mtime8.out'/x(mtime8).
1542 print outfile='mtime8.1.out'/x(mtime8.1).
1543 print outfile='mtime8.2.out'/x(mtime8.2).
1544 print outfile='mtime9.out'/x(mtime9).
1545 print outfile='mtime9.1.out'/x(mtime9.1).
1546 print outfile='mtime9.2.out'/x(mtime9.2).
1547 print outfile='mtime9.3.out'/x(mtime9.3).
1548 print outfile='mtime10.out'/x(mtime10).
1549 print outfile='mtime10.1.out'/x(mtime10.1).
1550 print outfile='mtime10.2.out'/x(mtime10.2).
1551 print outfile='mtime10.3.out'/x(mtime10.3).
1552 print outfile='mtime10.4.out'/x(mtime10.4).
1553 print outfile='mtime11.out'/x(mtime11).
1554 print outfile='mtime11.1.out'/x(mtime11.1).
1555 print outfile='mtime11.2.out'/x(mtime11.2).
1556 print outfile='mtime11.3.out'/x(mtime11.3).
1557 print outfile='mtime11.4.out'/x(mtime11.4).
1558 print outfile='mtime11.5.out'/x(mtime11.5).
1559 print outfile='mtime12.5.out'/x(mtime12.5).
1560 print outfile='mtime13.5.out'/x(mtime13.5).
1561 print outfile='mtime14.5.out'/x(mtime14.5).
1562 print outfile='mtime15.5.out'/x(mtime15.5).
1563 print outfile='mtime16.5.out'/x(mtime16.5).
1566 AT_CHECK([pspp -O format=csv time-out.sps])
1567 AT_CHECK([cat time5.out], [0], [dnl
1769 AT_CHECK([cat time6.out], [0], [dnl
1971 AT_CHECK([cat time7.out], [0], [dnl
2173 AT_CHECK([cat time8.out], [0], [dnl
2375 AT_CHECK([cat time9.out], [0], [dnl
2577 AT_CHECK([cat time10.out], [0], [dnl
2779 AT_CHECK([cat time10.1.out], [0], [dnl
2981 AT_CHECK([cat time11.out], [0], [dnl
3183 AT_CHECK([cat time11.1.out], [0], [dnl
3385 AT_CHECK([cat time11.2.out], [0], [dnl
3587 AT_CHECK([cat time12.out], [0], [dnl
3789 AT_CHECK([cat time12.1.out], [0], [dnl
3991 AT_CHECK([cat time12.2.out], [0], [dnl
4193 AT_CHECK([cat time12.3.out], [0], [dnl
4395 AT_CHECK([cat time13.out], [0], [dnl
4597 AT_CHECK([cat time13.1.out], [0], [dnl
4799 AT_CHECK([cat time13.2.out], [0], [dnl
5001 AT_CHECK([cat time13.3.out], [0], [dnl
5203 AT_CHECK([cat time13.4.out], [0], [dnl
5405 AT_CHECK([cat time14.out], [0], [dnl
5607 AT_CHECK([cat time14.1.out], [0], [dnl
5809 AT_CHECK([cat time14.2.out], [0], [dnl
6011 AT_CHECK([cat time14.3.out], [0], [dnl
6213 AT_CHECK([cat time14.4.out], [0], [dnl
6415 AT_CHECK([cat time14.5.out], [0], [dnl
6617 AT_CHECK([cat time15.out], [0], [dnl
6819 AT_CHECK([cat time15.1.out], [0], [dnl
7021 AT_CHECK([cat time15.2.out], [0], [dnl
7223 AT_CHECK([cat time15.3.out], [0], [dnl
7425 AT_CHECK([cat time15.4.out], [0], [dnl
7627 AT_CHECK([cat time15.5.out], [0], [dnl
7829 AT_CHECK([cat time15.6.out], [0], [dnl
8031 AT_CHECK([cat dtime8.out], [0], [dnl
8233 AT_CHECK([cat dtime9.out], [0], [dnl
8435 AT_CHECK([cat dtime10.out], [0], [dnl
8637 AT_CHECK([cat dtime11.out], [0], [dnl
8839 AT_CHECK([cat dtime12.out], [0], [dnl
9041 AT_CHECK([cat dtime13.out], [0], [dnl
9243 AT_CHECK([cat dtime13.1.out], [0], [dnl
9445 AT_CHECK([cat dtime14.out], [0], [dnl
9647 AT_CHECK([cat dtime14.1.out], [0], [dnl
9849 AT_CHECK([cat dtime14.2.out], [0], [dnl
10051 AT_CHECK([cat dtime15.out], [0], [dnl
10253 AT_CHECK([cat dtime15.1.out], [0], [dnl
10455 AT_CHECK([cat dtime15.2.out], [0], [dnl
10657 AT_CHECK([cat dtime15.3.out], [0], [dnl
10859 AT_CHECK([cat dtime16.out], [0], [dnl
11061 AT_CHECK([cat dtime16.1.out], [0], [dnl
11263 AT_CHECK([cat dtime16.2.out], [0], [dnl
11465 AT_CHECK([cat dtime16.3.out], [0], [dnl
11667 AT_CHECK([cat dtime16.4.out], [0], [dnl
11869 AT_CHECK([cat dtime17.out], [0], [dnl
12071 AT_CHECK([cat dtime17.1.out], [0], [dnl
12273 AT_CHECK([cat dtime17.2.out], [0], [dnl
12475 AT_CHECK([cat dtime17.3.out], [0], [dnl
12677 AT_CHECK([cat dtime17.4.out], [0], [dnl
12879 AT_CHECK([cat dtime17.5.out], [0], [dnl
13081 AT_CHECK([cat dtime18.out], [0], [dnl
13283 AT_CHECK([cat dtime18.1.out], [0], [dnl
13485 AT_CHECK([cat dtime18.2.out], [0], [dnl
13687 AT_CHECK([cat dtime18.3.out], [0], [dnl
13889 AT_CHECK([cat dtime18.4.out], [0], [dnl
14091 AT_CHECK([cat dtime18.5.out], [0], [dnl
14293 AT_CHECK([cat dtime18.6.out], [0], [dnl
14495 AT_CHECK([cat mtime5.out], [0], [dnl
14697 AT_CHECK([cat mtime6.out], [0], [dnl
14899 AT_CHECK([cat mtime7.out], [0], [dnl
15101 AT_CHECK([cat mtime7.1.out], [0], [dnl
15303 AT_CHECK([cat mtime8.out], [0], [dnl
15505 AT_CHECK([cat mtime8.1.out], [0], [dnl
15707 AT_CHECK([cat mtime8.2.out], [0], [dnl
15909 AT_CHECK([cat mtime9.out], [0], [dnl
16111 AT_CHECK([cat mtime9.1.out], [0], [dnl
16313 AT_CHECK([cat mtime9.2.out], [0], [dnl
16515 AT_CHECK([cat mtime9.3.out], [0], [dnl
16717 AT_CHECK([cat mtime10.out], [0], [dnl
16919 AT_CHECK([cat mtime10.1.out], [0], [dnl
17121 AT_CHECK([cat mtime10.2.out], [0], [dnl
17323 AT_CHECK([cat mtime10.3.out], [0], [dnl
17525 AT_CHECK([cat mtime10.4.out], [0], [dnl
17727 AT_CHECK([cat mtime11.out], [0], [dnl
17929 AT_CHECK([cat mtime11.1.out], [0], [dnl
18131 AT_CHECK([cat mtime11.2.out], [0], [dnl
18333 AT_CHECK([cat mtime11.3.out], [0], [dnl
18535 AT_CHECK([cat mtime11.4.out], [0], [dnl
18737 AT_CHECK([cat mtime11.5.out], [0], [dnl
18939 AT_CHECK([cat mtime12.5.out], [0], [dnl
19141 AT_CHECK([cat mtime13.5.out], [0], [dnl
19343 AT_CHECK([cat mtime14.5.out], [0], [dnl
19545 AT_CHECK([cat mtime15.5.out], [0], [dnl
19747 AT_CHECK([cat mtime16.5.out], [0], [dnl
19951 AT_SETUP([MONTH output])
19952 AT_KEYWORDS([data-out])
19953 AT_DATA([month-out.sps], [dnl
19955 set mxwarns=10000000.
19956 data list notable/x 1-10.
19982 print outfile='month-out.out'/x(month3).
19983 print outfile='month-out.out'/x(month4).
19984 print outfile='month-out.out'/x(month5).
19985 print outfile='month-out.out'/x(month6).
19986 print outfile='month-out.out'/x(month7).
19987 print outfile='month-out.out'/x(month8).
19988 print outfile='month-out.out'/x(month9).
19989 print outfile='month-out.out'/x(month10).
19990 print outfile='month-out.out'/x(month11).
19991 print outfile='month-out.out'/x(month12).
19992 print outfile='month-out.out'/x(month13).
19993 print outfile='month-out.out'/x(month14).
19994 print outfile='month-out.out'/x(month15).
19995 print outfile='month-out.out'/x(month16).
19996 print outfile='month-out.out'/x(month17).
19997 print outfile='month-out.out'/x(month18).
19998 print outfile='month-out.out'/x(month19).
19999 print outfile='month-out.out'/x(month20).
20000 print outfile='month-out.out'/x(month21).
20001 print outfile='month-out.out'/x(month22).
20002 print outfile='month-out.out'/x(month23).
20003 print outfile='month-out.out'/x(month24).
20004 print outfile='month-out.out'/x(month25).
20005 print outfile='month-out.out'/x(month26).
20006 print outfile='month-out.out'/x(month27).
20007 print outfile='month-out.out'/x(month28).
20008 print outfile='month-out.out'/x(month29).
20009 print outfile='month-out.out'/x(month30).
20010 print outfile='month-out.out'/x(month31).
20011 print outfile='month-out.out'/x(month32).
20012 print outfile='month-out.out'/x(month33).
20013 print outfile='month-out.out'/x(month34).
20014 print outfile='month-out.out'/x(month35).
20015 print outfile='month-out.out'/x(month36).
20016 print outfile='month-out.out'/x(month37).
20017 print outfile='month-out.out'/x(month38).
20018 print outfile='month-out.out'/x(month39).
20019 print outfile='month-out.out'/x(month40).
20022 AT_CHECK([pspp -O format=csv month-out.sps], [1], [stdout])
20023 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
20025 38 error: Month number 0.000000 is not between 1 and 12.
20026 38 error: Month number 0.500000 is not between 1 and 12.
20027 38 error: Month number 0.900000 is not between 1 and 12.
20028 38 error: Month number 13.000000 is not between 1 and 12.
20030 AT_CHECK([cat month-out.out], [0], [dnl
20908 AT_SETUP([WKDAY output])
20909 AT_KEYWORDS([data-out])
20910 AT_DATA([wkday-out.sps], [dnl
20911 set mxwarns=10000000.
20912 set mxerrs=10000000.
20913 data list notable/x 1-10.
20934 do repeat format=wkday2 to wkday40.
20935 print outfile='wkday-out.out'/x(format).
20939 AT_CHECK([pspp -O format=csv wkday-out.sps], [1], [stdout])
20940 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
20942 39 error: Weekday number 0.000000 is not between 1 and 7.
20943 39 error: Weekday number 0.500000 is not between 1 and 7.
20944 39 error: Weekday number 0.900000 is not between 1 and 7.
20945 39 error: Weekday number 8.000000 is not between 1 and 7.
20947 AT_CHECK([cat wkday-out.out], [0], [dnl
21653 dnl This checks for a regression where AHEX output would crash due to
21654 dnl dereferencing string data as a pointer, for string widths between
21655 dnl 5 and 8, inclusive.
21656 AT_SETUP([AHEX output bug])
21657 AT_KEYWORDS([data-out])
21658 AT_DATA([ahex.sps], [
21659 DATA LIST NOTABLE /s (a8).
21663 FORMATS s (AHEX16).
21666 AT_CHECK([pspp -O format=csv ahex.sps], [0], [dnl