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([non-ASCII custom currency formats])
251 AT_KEYWORDS([data-out])
252 AT_DATA([data-out.sps], [dnl
255 DATA LIST LIST NOTABLE/x.
256 PRINT/x (F8.2) x (CCA10.2).
268 AT_CHECK([pspp -O format=csv data-out.sps], [0], [dnl
269 "data-out.sps:2: note: SHOW: CCA is «,¥,€,»."
281 1.5E+010 ¥2E+010€ @&t@
287 AT_SETUP([binary and hexadecimal output])
288 AT_KEYWORDS([data-out])
289 AT_DATA([binhex-out.sps], [dnl
291 SET MXWARNS=10000000.
293 DATA LIST NOTABLE/x 1-10.
364 FILE HANDLE output/NAME='binhex.out'/MODE=IMAGE/LRECL=256.
365 WRITE OUTFILE=output/
366 x(p1.0) x(p2.0) x(p3.0) x(p4.0) /* 000
367 x(p2.1) x(p3.1) x(p4.1) /* 00a
368 x(p3.2) x(p4.2) /* 013
370 x(pk1.0) x(pk2.0) x(pk3.0) x(pk4.0) /* 01e
371 x(pk2.1) x(pk3.1) x(pk4.1) /* 028
372 x(pk3.2) x(pk4.2) /* 031
374 x(ib1.0) x(ib2.0) x(ib3.0) x(ib4.0) /* 03c
375 x(ib1.1) x(ib2.1) x(ib3.1) x(ib4.1) /* 046
376 x(ib1.2) x(ib2.2) x(ib3.2) x(ib4.2) /* 050
377 x(ib1.3) x(ib2.3) x(ib3.3) x(ib4.3) /* 05a
378 x(ib2.4) x(ib3.4) x(ib4.4) /* 064
379 x(ib2.5) x(ib3.5) x(ib4.5) /* 06d
380 x(ib3.6) x(ib4.6) /* 076
381 x(ib3.7) x(ib4.7) /* 07d
382 x(ib3.8) x(ib4.8) /* 084
385 x(pib1.0) x(pib2.0) x(pib3.0) x(pib4.0) /* 093
386 x(pib1.1) x(pib2.1) x(pib3.1) x(pib4.1) /* 09d
387 x(pib1.2) x(pib2.2) x(pib3.2) x(pib4.2) /* 0a7
388 x(pib1.3) x(pib2.3) x(pib3.3) x(pib4.3) /* 0b1
389 x(pib2.4) x(pib3.4) x(pib4.4) /* 0bb
390 x(pib2.5) x(pib3.5) x(pib4.5) /* 0c4
391 x(pib3.6) x(pib4.6) /* 0cd
392 x(pib3.7) x(pib4.7) /* 0d4
393 x(pib3.8) x(pib4.8) /* 0db
396 x(pibhex2) x(pibhex4) /* 0ea
397 x(pibhex6) x(pibhex8). /* 0f0
401 AT_CHECK([pspp -O format=csv binhex-out.sps])
402 AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-out.expected.gz > expout])
403 AT_CHECK([cat binhex.out], [0], [expout])
406 AT_SETUP([output valid dates])
407 AT_KEYWORDS([data-out])
408 AT_DATA([date-out.sps], [dnl
410 data list notable /x 1-30 (datetime).
413 30-6-1680 4:50:38.12301
414 24-7-1716 12:31:35.23453
415 19-6-1768 12:47:53.34505
416 2-8-1819 1:26:0.45615
417 27-3-1839 20:58:11.56677
418 19-4-1903 7:36:5.18964
419 25-8-1929 15:43:49.83132
420 29-9-1941 4:25:9.01293
421 19-4-1943 6:49:27.52375
422 7-10-1943 2:57:52.01565
423 17-3-1992 16:45:44.86529
424 25-2-1996 21:30:57.82047
426 19-4-43 6:49:27.10533
427 7-10-43 2:57:52.48229
428 17-3-92 16:45:44.65827
429 25-2-96 21:30:57.58219
430 10-11-2038 22:30:4.18347
431 18-7-2094 1:56:51.59319
433 print outfile='date.out'/x(date9) ' | ' x(date11).
434 print outfile='adate.out'/x(adate8) ' | ' x(adate10).
435 print outfile='edate.out'/x(edate8) ' | ' x(edate10).
436 print outfile='jdate.out'/x(jdate5) ' | ' x(jdate7).
437 print outfile='sdate.out'/x(sdate8) ' | ' x(sdate10).
438 print outfile='qyr.out'/x(qyr6) ' | ' x(qyr8).
439 print outfile='moyr.out'/x(moyr6) ' | ' x(moyr8).
440 print outfile='wkyr.out'/x(wkyr8) ' | ' x(wkyr10).
441 print outfile='datetime17.out'/x(datetime17).
442 print outfile='datetime18.out'/x(datetime18).
443 print outfile='datetime19.out'/x(datetime19).
444 print outfile='datetime20.out'/x(datetime20).
445 print outfile='datetime21.out'/x(datetime21).
446 print outfile='datetime22.out'/x(datetime22).
447 print outfile='datetime22.1.out'/x(datetime22.1).
448 print outfile='datetime23.2.out'/x(datetime23.2).
449 print outfile='datetime24.3.out'/x(datetime24.3).
450 print outfile='datetime25.4.out'/x(datetime25.4).
451 print outfile='datetime26.5.out'/x(datetime26.5).
452 print outfile='ymdhms16.out'/x(ymdhms16).
453 print outfile='ymdhms17.out'/x(ymdhms17).
454 print outfile='ymdhms18.out'/x(ymdhms18).
455 print outfile='ymdhms19.out'/x(ymdhms19).
456 print outfile='ymdhms20.out'/x(ymdhms20).
457 print outfile='ymdhms21.out'/x(ymdhms21).
458 print outfile='ymdhms21.1.out'/x(ymdhms21.1).
459 print outfile='ymdhms22.2.out'/x(ymdhms22.2).
460 print outfile='ymdhms23.3.out'/x(ymdhms23.3).
461 print outfile='ymdhms24.4.out'/x(ymdhms24.4).
462 print outfile='ymdhms25.5.out'/x(ymdhms25.5).
465 AT_CHECK([pspp -O format=csv date-out.sps])
466 AT_CHECK([cat date.out], [0], [dnl
467 ********* | 10-JUN-1648
468 ********* | 30-JUN-1680
469 ********* | 24-JUL-1716
470 ********* | 19-JUN-1768
471 ********* | 02-AUG-1819
472 ********* | 27-MAR-1839
473 ********* | 19-APR-1903
474 ********* | 25-AUG-1929
475 29-SEP-41 | 29-SEP-1941
476 19-APR-43 | 19-APR-1943
477 07-OCT-43 | 07-OCT-1943
478 17-MAR-92 | 17-MAR-1992
479 25-FEB-96 | 25-FEB-1996
480 29-SEP-41 | 29-SEP-1941
481 19-APR-43 | 19-APR-1943
482 07-OCT-43 | 07-OCT-1943
483 17-MAR-92 | 17-MAR-1992
484 25-FEB-96 | 25-FEB-1996
485 ********* | 10-NOV-2038
486 ********* | 18-JUL-2094
488 AT_CHECK([cat adate.out], [0], [dnl
489 ******** | 06/10/1648
490 ******** | 06/30/1680
491 ******** | 07/24/1716
492 ******** | 06/19/1768
493 ******** | 08/02/1819
494 ******** | 03/27/1839
495 ******** | 04/19/1903
496 ******** | 08/25/1929
497 09/29/41 | 09/29/1941
498 04/19/43 | 04/19/1943
499 10/07/43 | 10/07/1943
500 03/17/92 | 03/17/1992
501 02/25/96 | 02/25/1996
502 09/29/41 | 09/29/1941
503 04/19/43 | 04/19/1943
504 10/07/43 | 10/07/1943
505 03/17/92 | 03/17/1992
506 02/25/96 | 02/25/1996
507 ******** | 11/10/2038
508 ******** | 07/18/2094
510 AT_CHECK([cat edate.out], [0], [dnl
511 ******** | 10.06.1648
512 ******** | 30.06.1680
513 ******** | 24.07.1716
514 ******** | 19.06.1768
515 ******** | 02.08.1819
516 ******** | 27.03.1839
517 ******** | 19.04.1903
518 ******** | 25.08.1929
519 29.09.41 | 29.09.1941
520 19.04.43 | 19.04.1943
521 07.10.43 | 07.10.1943
522 17.03.92 | 17.03.1992
523 25.02.96 | 25.02.1996
524 29.09.41 | 29.09.1941
525 19.04.43 | 19.04.1943
526 07.10.43 | 07.10.1943
527 17.03.92 | 17.03.1992
528 25.02.96 | 25.02.1996
529 ******** | 10.11.2038
530 ******** | 18.07.2094
532 AT_CHECK([cat jdate.out], [0], [dnl
554 AT_CHECK([cat sdate.out], [0], [dnl
555 ******** | 1648/06/10
556 ******** | 1680/06/30
557 ******** | 1716/07/24
558 ******** | 1768/06/19
559 ******** | 1819/08/02
560 ******** | 1839/03/27
561 ******** | 1903/04/19
562 ******** | 1929/08/25
563 41/09/29 | 1941/09/29
564 43/04/19 | 1943/04/19
565 43/10/07 | 1943/10/07
566 92/03/17 | 1992/03/17
567 96/02/25 | 1996/02/25
568 41/09/29 | 1941/09/29
569 43/04/19 | 1943/04/19
570 43/10/07 | 1943/10/07
571 92/03/17 | 1992/03/17
572 96/02/25 | 1996/02/25
573 ******** | 2038/11/10
574 ******** | 2094/07/18
576 AT_CHECK([cat qyr.out], [0], [dnl
598 AT_CHECK([cat moyr.out], [0], [dnl
620 AT_CHECK([cat wkyr.out], [0], [dnl
621 ******** | 24 WK 1648
622 ******** | 26 WK 1680
623 ******** | 30 WK 1716
624 ******** | 25 WK 1768
625 ******** | 31 WK 1819
626 ******** | 13 WK 1839
627 ******** | 16 WK 1903
628 ******** | 34 WK 1929
629 39 WK 41 | 39 WK 1941
630 16 WK 43 | 16 WK 1943
631 40 WK 43 | 40 WK 1943
632 11 WK 92 | 11 WK 1992
634 39 WK 41 | 39 WK 1941
635 16 WK 43 | 16 WK 1943
636 40 WK 43 | 40 WK 1943
637 11 WK 92 | 11 WK 1992
639 ******** | 45 WK 2038
640 ******** | 29 WK 2094
642 AT_CHECK([cat datetime17.out], [0], [dnl
664 AT_CHECK([cat datetime18.out], [0], [dnl
686 AT_CHECK([cat datetime19.out], [0], [dnl
708 AT_CHECK([cat datetime20.out], [0], [dnl
730 AT_CHECK([cat datetime21.out], [0], [dnl
752 AT_CHECK([cat datetime22.out], [0], [dnl
774 AT_CHECK([cat datetime22.1.out], [0], [dnl
775 10-JUN-1648 00:00:00.0
776 30-JUN-1680 04:50:38.1
777 24-JUL-1716 12:31:35.2
778 19-JUN-1768 12:47:53.3
779 02-AUG-1819 01:26:00.5
780 27-MAR-1839 20:58:11.6
781 19-APR-1903 07:36:05.2
782 25-AUG-1929 15:43:49.8
783 29-SEP-1941 04:25:09.0
784 19-APR-1943 06:49:27.5
785 07-OCT-1943 02:57:52.0
786 17-MAR-1992 16:45:44.9
787 25-FEB-1996 21:30:57.8
788 29-SEP-1941 04:25:09.2
789 19-APR-1943 06:49:27.1
790 07-OCT-1943 02:57:52.5
791 17-MAR-1992 16:45:44.7
792 25-FEB-1996 21:30:57.6
793 10-NOV-2038 22:30:04.2
794 18-JUL-2094 01:56:51.6
796 AT_CHECK([cat datetime23.2.out], [0], [dnl
797 10-JUN-1648 00:00:00.00
798 30-JUN-1680 04:50:38.12
799 24-JUL-1716 12:31:35.23
800 19-JUN-1768 12:47:53.35
801 02-AUG-1819 01:26:00.46
802 27-MAR-1839 20:58:11.57
803 19-APR-1903 07:36:05.19
804 25-AUG-1929 15:43:49.83
805 29-SEP-1941 04:25:09.01
806 19-APR-1943 06:49:27.52
807 07-OCT-1943 02:57:52.02
808 17-MAR-1992 16:45:44.87
809 25-FEB-1996 21:30:57.82
810 29-SEP-1941 04:25:09.15
811 19-APR-1943 06:49:27.11
812 07-OCT-1943 02:57:52.48
813 17-MAR-1992 16:45:44.66
814 25-FEB-1996 21:30:57.58
815 10-NOV-2038 22:30:04.18
816 18-JUL-2094 01:56:51.59
818 AT_CHECK([cat datetime24.3.out], [0], [dnl
819 10-JUN-1648 00:00:00.000
820 30-JUN-1680 04:50:38.123
821 24-JUL-1716 12:31:35.235
822 19-JUN-1768 12:47:53.345
823 02-AUG-1819 01:26:00.456
824 27-MAR-1839 20:58:11.567
825 19-APR-1903 07:36:05.190
826 25-AUG-1929 15:43:49.831
827 29-SEP-1941 04:25:09.013
828 19-APR-1943 06:49:27.524
829 07-OCT-1943 02:57:52.016
830 17-MAR-1992 16:45:44.865
831 25-FEB-1996 21:30:57.820
832 29-SEP-1941 04:25:09.154
833 19-APR-1943 06:49:27.105
834 07-OCT-1943 02:57:52.482
835 17-MAR-1992 16:45:44.658
836 25-FEB-1996 21:30:57.582
837 10-NOV-2038 22:30:04.183
838 18-JUL-2094 01:56:51.593
840 AT_CHECK([cat datetime25.4.out], [0], [dnl
841 10-JUN-1648 00:00:00.0000
842 30-JUN-1680 04:50:38.1230
843 24-JUL-1716 12:31:35.2345
844 19-JUN-1768 12:47:53.3450
845 02-AUG-1819 01:26:00.4562
846 27-MAR-1839 20:58:11.5668
847 19-APR-1903 07:36:05.1896
848 25-AUG-1929 15:43:49.8313
849 29-SEP-1941 04:25:09.0129
850 19-APR-1943 06:49:27.5238
851 07-OCT-1943 02:57:52.0156
852 17-MAR-1992 16:45:44.8653
853 25-FEB-1996 21:30:57.8205
854 29-SEP-1941 04:25:09.1539
855 19-APR-1943 06:49:27.1053
856 07-OCT-1943 02:57:52.4823
857 17-MAR-1992 16:45:44.6583
858 25-FEB-1996 21:30:57.5822
859 10-NOV-2038 22:30:04.1835
860 18-JUL-2094 01:56:51.5932
862 AT_CHECK([cat datetime26.5.out], [0], [dnl
863 10-JUN-1648 00:00:00.00000
864 30-JUN-1680 04:50:38.12301
865 24-JUL-1716 12:31:35.23453
866 19-JUN-1768 12:47:53.34505
867 02-AUG-1819 01:26:00.45615
868 27-MAR-1839 20:58:11.56677
869 19-APR-1903 07:36:05.18964
870 25-AUG-1929 15:43:49.83132
871 29-SEP-1941 04:25:09.01293
872 19-APR-1943 06:49:27.52375
873 07-OCT-1943 02:57:52.01565
874 17-MAR-1992 16:45:44.86529
875 25-FEB-1996 21:30:57.82047
876 29-SEP-1941 04:25:09.15395
877 19-APR-1943 06:49:27.10533
878 07-OCT-1943 02:57:52.48229
879 17-MAR-1992 16:45:44.65827
880 25-FEB-1996 21:30:57.58219
881 10-NOV-2038 22:30:04.18347
882 18-JUL-2094 01:56:51.59319
884 AT_CHECK([cat ymdhms16.out], [0], [dnl
906 AT_CHECK([cat ymdhms17.out], [0], [dnl
928 AT_CHECK([cat ymdhms18.out], [0], [dnl
950 AT_CHECK([cat ymdhms19.out], [0], [dnl
972 AT_CHECK([cat ymdhms20.out], [0], [dnl
994 AT_CHECK([cat ymdhms21.out], [0], [dnl
1016 AT_CHECK([cat ymdhms21.1.out], [0], [dnl
1017 1648-06-10 00:00:00.0
1018 1680-06-30 04:50:38.1
1019 1716-07-24 12:31:35.2
1020 1768-06-19 12:47:53.3
1021 1819-08-02 01:26:00.5
1022 1839-03-27 20:58:11.6
1023 1903-04-19 07:36:05.2
1024 1929-08-25 15:43:49.8
1025 1941-09-29 04:25:09.0
1026 1943-04-19 06:49:27.5
1027 1943-10-07 02:57:52.0
1028 1992-03-17 16:45:44.9
1029 1996-02-25 21:30:57.8
1030 1941-09-29 04:25:09.2
1031 1943-04-19 06:49:27.1
1032 1943-10-07 02:57:52.5
1033 1992-03-17 16:45:44.7
1034 1996-02-25 21:30:57.6
1035 2038-11-10 22:30:04.2
1036 2094-07-18 01:56:51.6
1038 AT_CHECK([cat ymdhms22.2.out], [0], [dnl
1039 1648-06-10 00:00:00.00
1040 1680-06-30 04:50:38.12
1041 1716-07-24 12:31:35.23
1042 1768-06-19 12:47:53.35
1043 1819-08-02 01:26:00.46
1044 1839-03-27 20:58:11.57
1045 1903-04-19 07:36:05.19
1046 1929-08-25 15:43:49.83
1047 1941-09-29 04:25:09.01
1048 1943-04-19 06:49:27.52
1049 1943-10-07 02:57:52.02
1050 1992-03-17 16:45:44.87
1051 1996-02-25 21:30:57.82
1052 1941-09-29 04:25:09.15
1053 1943-04-19 06:49:27.11
1054 1943-10-07 02:57:52.48
1055 1992-03-17 16:45:44.66
1056 1996-02-25 21:30:57.58
1057 2038-11-10 22:30:04.18
1058 2094-07-18 01:56:51.59
1060 AT_CHECK([cat ymdhms23.3.out], [0], [dnl
1061 1648-06-10 00:00:00.000
1062 1680-06-30 04:50:38.123
1063 1716-07-24 12:31:35.235
1064 1768-06-19 12:47:53.345
1065 1819-08-02 01:26:00.456
1066 1839-03-27 20:58:11.567
1067 1903-04-19 07:36:05.190
1068 1929-08-25 15:43:49.831
1069 1941-09-29 04:25:09.013
1070 1943-04-19 06:49:27.524
1071 1943-10-07 02:57:52.016
1072 1992-03-17 16:45:44.865
1073 1996-02-25 21:30:57.820
1074 1941-09-29 04:25:09.154
1075 1943-04-19 06:49:27.105
1076 1943-10-07 02:57:52.482
1077 1992-03-17 16:45:44.658
1078 1996-02-25 21:30:57.582
1079 2038-11-10 22:30:04.183
1080 2094-07-18 01:56:51.593
1082 AT_CHECK([cat ymdhms24.4.out], [0], [dnl
1083 1648-06-10 00:00:00.0000
1084 1680-06-30 04:50:38.1230
1085 1716-07-24 12:31:35.2345
1086 1768-06-19 12:47:53.3450
1087 1819-08-02 01:26:00.4562
1088 1839-03-27 20:58:11.5668
1089 1903-04-19 07:36:05.1896
1090 1929-08-25 15:43:49.8313
1091 1941-09-29 04:25:09.0129
1092 1943-04-19 06:49:27.5238
1093 1943-10-07 02:57:52.0156
1094 1992-03-17 16:45:44.8653
1095 1996-02-25 21:30:57.8205
1096 1941-09-29 04:25:09.1539
1097 1943-04-19 06:49:27.1053
1098 1943-10-07 02:57:52.4823
1099 1992-03-17 16:45:44.6583
1100 1996-02-25 21:30:57.5822
1101 2038-11-10 22:30:04.1835
1102 2094-07-18 01:56:51.5932
1104 AT_CHECK([cat ymdhms25.5.out], [0], [dnl
1105 1648-06-10 00:00:00.00000
1106 1680-06-30 04:50:38.12301
1107 1716-07-24 12:31:35.23453
1108 1768-06-19 12:47:53.34505
1109 1819-08-02 01:26:00.45615
1110 1839-03-27 20:58:11.56677
1111 1903-04-19 07:36:05.18964
1112 1929-08-25 15:43:49.83132
1113 1941-09-29 04:25:09.01293
1114 1943-04-19 06:49:27.52375
1115 1943-10-07 02:57:52.01565
1116 1992-03-17 16:45:44.86529
1117 1996-02-25 21:30:57.82047
1118 1941-09-29 04:25:09.15395
1119 1943-04-19 06:49:27.10533
1120 1943-10-07 02:57:52.48229
1121 1992-03-17 16:45:44.65827
1122 1996-02-25 21:30:57.58219
1123 2038-11-10 22:30:04.18347
1124 2094-07-18 01:56:51.59319
1128 AT_SETUP([output invalid dates])
1129 AT_KEYWORDS([data-out])
1130 AT_DATA([bad-date.sps], [dnl
1133 data list list notable/x.
1139 print outfile='bad-date.out'/x(date9) ' | ' x(date11).
1140 print outfile='bad-date.out'/x(adate8) ' | ' x(adate10).
1141 print outfile='bad-date.out'/x(edate8) ' | ' x(edate10).
1142 print outfile='bad-date.out'/x(jdate5) ' | ' x(jdate7).
1143 print outfile='bad-date.out'/x(sdate8) ' | ' x(sdate10).
1144 print outfile='bad-date.out'/x(qyr6) ' | ' x(qyr8).
1145 print outfile='bad-date.out'/x(moyr6) ' | ' x(moyr8).
1146 print outfile='bad-date.out'/x(wkyr8) ' | ' x(wkyr10).
1147 print outfile='bad-date.out'/x(datetime17).
1148 print outfile='bad-date.out'/x(datetime18).
1149 print outfile='bad-date.out'/x(datetime19).
1150 print outfile='bad-date.out'/x(datetime20).
1151 print outfile='bad-date.out'/x(datetime21).
1152 print outfile='bad-date.out'/x(datetime22).
1153 print outfile='bad-date.out'/x(datetime22.1).
1154 print outfile='bad-date.out'/x(datetime23.2).
1155 print outfile='bad-date.out'/x(datetime24.3).
1156 print outfile='bad-date.out'/x(datetime25.4).
1157 print outfile='bad-date.out'/x(datetime26.5).
1160 AT_CHECK([pspp -O format=csv bad-date.sps])
1161 AT_CHECK([cat bad-date.out], [0], [dnl
1200 ********* | ***********
1201 ******** | **********
1202 ******** | **********
1204 ******** | **********
1207 ******** | **********
1211 28-MAY-**** 05:20:00
1212 28-MAY-**** 05:20:00
1213 28-MAY-**** 05:20:00
1214 28-MAY-**** 05:20:00.0
1215 28-MAY-**** 05:20:00.00
1216 28-MAY-**** 05:20:00.000
1217 28-MAY-**** 05:20:00.0000
1218 28-MAY-**** 05:20:00.00000
1222 AT_SETUP([time output])
1223 AT_KEYWORDS([data-out])
1224 AT_DATA([time-out.sps], [dnl
1226 data list notable /x 1-30 (dtime).
1429 print outfile='time5.out'/x(time5).
1430 print outfile='time6.out'/x(time6).
1431 print outfile='time7.out'/x(time7).
1432 print outfile='time8.out'/x(time8).
1433 print outfile='time9.out'/x(time9).
1434 print outfile='time10.out'/x(time10).
1435 print outfile='time10.1.out'/x(time10.1).
1436 print outfile='time11.out'/x(time11).
1437 print outfile='time11.1.out'/x(time11.1).
1438 print outfile='time11.2.out'/x(time11.2).
1439 print outfile='time12.out'/x(time12).
1440 print outfile='time12.1.out'/x(time12.1).
1441 print outfile='time12.2.out'/x(time12.2).
1442 print outfile='time12.3.out'/x(time12.3).
1443 print outfile='time13.out'/x(time13).
1444 print outfile='time13.1.out'/x(time13.1).
1445 print outfile='time13.2.out'/x(time13.2).
1446 print outfile='time13.3.out'/x(time13.3).
1447 print outfile='time13.4.out'/x(time13.4).
1448 print outfile='time14.out'/x(time14).
1449 print outfile='time14.1.out'/x(time14.1).
1450 print outfile='time14.2.out'/x(time14.2).
1451 print outfile='time14.3.out'/x(time14.3).
1452 print outfile='time14.4.out'/x(time14.4).
1453 print outfile='time14.5.out'/x(time14.5).
1454 print outfile='time15.out'/x(time15).
1455 print outfile='time15.1.out'/x(time15.1).
1456 print outfile='time15.2.out'/x(time15.2).
1457 print outfile='time15.3.out'/x(time15.3).
1458 print outfile='time15.4.out'/x(time15.4).
1459 print outfile='time15.5.out'/x(time15.5).
1460 print outfile='time15.6.out'/x(time15.6).
1461 print outfile='dtime8.out'/x(dtime8).
1462 print outfile='dtime9.out'/x(dtime9).
1463 print outfile='dtime10.out'/x(dtime10).
1464 print outfile='dtime11.out'/x(dtime11).
1465 print outfile='dtime12.out'/x(dtime12).
1466 print outfile='dtime13.out'/x(dtime13).
1467 print outfile='dtime13.1.out'/x(dtime13.1).
1468 print outfile='dtime14.out'/x(dtime14).
1469 print outfile='dtime14.1.out'/x(dtime14.1).
1470 print outfile='dtime14.2.out'/x(dtime14.2).
1471 print outfile='dtime15.out'/x(dtime15).
1472 print outfile='dtime15.1.out'/x(dtime15.1).
1473 print outfile='dtime15.2.out'/x(dtime15.2).
1474 print outfile='dtime15.3.out'/x(dtime15.3).
1475 print outfile='dtime16.out'/x(dtime16).
1476 print outfile='dtime16.1.out'/x(dtime16.1).
1477 print outfile='dtime16.2.out'/x(dtime16.2).
1478 print outfile='dtime16.3.out'/x(dtime16.3).
1479 print outfile='dtime16.4.out'/x(dtime16.4).
1480 print outfile='dtime17.out'/x(dtime17).
1481 print outfile='dtime17.1.out'/x(dtime17.1).
1482 print outfile='dtime17.2.out'/x(dtime17.2).
1483 print outfile='dtime17.3.out'/x(dtime17.3).
1484 print outfile='dtime17.4.out'/x(dtime17.4).
1485 print outfile='dtime17.5.out'/x(dtime17.5).
1486 print outfile='dtime18.out'/x(dtime18).
1487 print outfile='dtime18.1.out'/x(dtime18.1).
1488 print outfile='dtime18.2.out'/x(dtime18.2).
1489 print outfile='dtime18.3.out'/x(dtime18.3).
1490 print outfile='dtime18.4.out'/x(dtime18.4).
1491 print outfile='dtime18.5.out'/x(dtime18.5).
1492 print outfile='dtime18.6.out'/x(dtime18.6).
1493 print outfile='mtime5.out'/x(mtime5).
1494 print outfile='mtime6.out'/x(mtime6).
1495 print outfile='mtime7.out'/x(mtime7).
1496 print outfile='mtime7.1.out'/x(mtime7.1).
1497 print outfile='mtime8.out'/x(mtime8).
1498 print outfile='mtime8.1.out'/x(mtime8.1).
1499 print outfile='mtime8.2.out'/x(mtime8.2).
1500 print outfile='mtime9.out'/x(mtime9).
1501 print outfile='mtime9.1.out'/x(mtime9.1).
1502 print outfile='mtime9.2.out'/x(mtime9.2).
1503 print outfile='mtime9.3.out'/x(mtime9.3).
1504 print outfile='mtime10.out'/x(mtime10).
1505 print outfile='mtime10.1.out'/x(mtime10.1).
1506 print outfile='mtime10.2.out'/x(mtime10.2).
1507 print outfile='mtime10.3.out'/x(mtime10.3).
1508 print outfile='mtime10.4.out'/x(mtime10.4).
1509 print outfile='mtime11.out'/x(mtime11).
1510 print outfile='mtime11.1.out'/x(mtime11.1).
1511 print outfile='mtime11.2.out'/x(mtime11.2).
1512 print outfile='mtime11.3.out'/x(mtime11.3).
1513 print outfile='mtime11.4.out'/x(mtime11.4).
1514 print outfile='mtime11.5.out'/x(mtime11.5).
1515 print outfile='mtime12.5.out'/x(mtime12.5).
1516 print outfile='mtime13.5.out'/x(mtime13.5).
1517 print outfile='mtime14.5.out'/x(mtime14.5).
1518 print outfile='mtime15.5.out'/x(mtime15.5).
1519 print outfile='mtime16.5.out'/x(mtime16.5).
1522 AT_CHECK([pspp -O format=csv time-out.sps])
1523 AT_CHECK([cat time5.out], [0], [dnl
1725 AT_CHECK([cat time6.out], [0], [dnl
1927 AT_CHECK([cat time7.out], [0], [dnl
2129 AT_CHECK([cat time8.out], [0], [dnl
2331 AT_CHECK([cat time9.out], [0], [dnl
2533 AT_CHECK([cat time10.out], [0], [dnl
2735 AT_CHECK([cat time10.1.out], [0], [dnl
2937 AT_CHECK([cat time11.out], [0], [dnl
3139 AT_CHECK([cat time11.1.out], [0], [dnl
3341 AT_CHECK([cat time11.2.out], [0], [dnl
3543 AT_CHECK([cat time12.out], [0], [dnl
3745 AT_CHECK([cat time12.1.out], [0], [dnl
3947 AT_CHECK([cat time12.2.out], [0], [dnl
4149 AT_CHECK([cat time12.3.out], [0], [dnl
4351 AT_CHECK([cat time13.out], [0], [dnl
4553 AT_CHECK([cat time13.1.out], [0], [dnl
4755 AT_CHECK([cat time13.2.out], [0], [dnl
4957 AT_CHECK([cat time13.3.out], [0], [dnl
5159 AT_CHECK([cat time13.4.out], [0], [dnl
5361 AT_CHECK([cat time14.out], [0], [dnl
5563 AT_CHECK([cat time14.1.out], [0], [dnl
5765 AT_CHECK([cat time14.2.out], [0], [dnl
5967 AT_CHECK([cat time14.3.out], [0], [dnl
6169 AT_CHECK([cat time14.4.out], [0], [dnl
6371 AT_CHECK([cat time14.5.out], [0], [dnl
6573 AT_CHECK([cat time15.out], [0], [dnl
6775 AT_CHECK([cat time15.1.out], [0], [dnl
6977 AT_CHECK([cat time15.2.out], [0], [dnl
7179 AT_CHECK([cat time15.3.out], [0], [dnl
7381 AT_CHECK([cat time15.4.out], [0], [dnl
7583 AT_CHECK([cat time15.5.out], [0], [dnl
7785 AT_CHECK([cat time15.6.out], [0], [dnl
7987 AT_CHECK([cat dtime8.out], [0], [dnl
8189 AT_CHECK([cat dtime9.out], [0], [dnl
8391 AT_CHECK([cat dtime10.out], [0], [dnl
8593 AT_CHECK([cat dtime11.out], [0], [dnl
8795 AT_CHECK([cat dtime12.out], [0], [dnl
8997 AT_CHECK([cat dtime13.out], [0], [dnl
9199 AT_CHECK([cat dtime13.1.out], [0], [dnl
9401 AT_CHECK([cat dtime14.out], [0], [dnl
9603 AT_CHECK([cat dtime14.1.out], [0], [dnl
9805 AT_CHECK([cat dtime14.2.out], [0], [dnl
10007 AT_CHECK([cat dtime15.out], [0], [dnl
10209 AT_CHECK([cat dtime15.1.out], [0], [dnl
10411 AT_CHECK([cat dtime15.2.out], [0], [dnl
10613 AT_CHECK([cat dtime15.3.out], [0], [dnl
10815 AT_CHECK([cat dtime16.out], [0], [dnl
11017 AT_CHECK([cat dtime16.1.out], [0], [dnl
11219 AT_CHECK([cat dtime16.2.out], [0], [dnl
11421 AT_CHECK([cat dtime16.3.out], [0], [dnl
11623 AT_CHECK([cat dtime16.4.out], [0], [dnl
11825 AT_CHECK([cat dtime17.out], [0], [dnl
12027 AT_CHECK([cat dtime17.1.out], [0], [dnl
12229 AT_CHECK([cat dtime17.2.out], [0], [dnl
12431 AT_CHECK([cat dtime17.3.out], [0], [dnl
12633 AT_CHECK([cat dtime17.4.out], [0], [dnl
12835 AT_CHECK([cat dtime17.5.out], [0], [dnl
13037 AT_CHECK([cat dtime18.out], [0], [dnl
13239 AT_CHECK([cat dtime18.1.out], [0], [dnl
13441 AT_CHECK([cat dtime18.2.out], [0], [dnl
13643 AT_CHECK([cat dtime18.3.out], [0], [dnl
13845 AT_CHECK([cat dtime18.4.out], [0], [dnl
14047 AT_CHECK([cat dtime18.5.out], [0], [dnl
14249 AT_CHECK([cat dtime18.6.out], [0], [dnl
14451 AT_CHECK([cat mtime5.out], [0], [dnl
14653 AT_CHECK([cat mtime6.out], [0], [dnl
14855 AT_CHECK([cat mtime7.out], [0], [dnl
15057 AT_CHECK([cat mtime7.1.out], [0], [dnl
15259 AT_CHECK([cat mtime8.out], [0], [dnl
15461 AT_CHECK([cat mtime8.1.out], [0], [dnl
15663 AT_CHECK([cat mtime8.2.out], [0], [dnl
15865 AT_CHECK([cat mtime9.out], [0], [dnl
16067 AT_CHECK([cat mtime9.1.out], [0], [dnl
16269 AT_CHECK([cat mtime9.2.out], [0], [dnl
16471 AT_CHECK([cat mtime9.3.out], [0], [dnl
16673 AT_CHECK([cat mtime10.out], [0], [dnl
16875 AT_CHECK([cat mtime10.1.out], [0], [dnl
17077 AT_CHECK([cat mtime10.2.out], [0], [dnl
17279 AT_CHECK([cat mtime10.3.out], [0], [dnl
17481 AT_CHECK([cat mtime10.4.out], [0], [dnl
17683 AT_CHECK([cat mtime11.out], [0], [dnl
17885 AT_CHECK([cat mtime11.1.out], [0], [dnl
18087 AT_CHECK([cat mtime11.2.out], [0], [dnl
18289 AT_CHECK([cat mtime11.3.out], [0], [dnl
18491 AT_CHECK([cat mtime11.4.out], [0], [dnl
18693 AT_CHECK([cat mtime11.5.out], [0], [dnl
18895 AT_CHECK([cat mtime12.5.out], [0], [dnl
19097 AT_CHECK([cat mtime13.5.out], [0], [dnl
19299 AT_CHECK([cat mtime14.5.out], [0], [dnl
19501 AT_CHECK([cat mtime15.5.out], [0], [dnl
19703 AT_CHECK([cat mtime16.5.out], [0], [dnl
19907 AT_SETUP([MONTH output])
19908 AT_KEYWORDS([data-out])
19909 AT_DATA([month-out.sps], [dnl
19911 set mxwarns=10000000.
19912 data list notable/x 1-10.
19938 print outfile='month-out.out'/x(month3).
19939 print outfile='month-out.out'/x(month4).
19940 print outfile='month-out.out'/x(month5).
19941 print outfile='month-out.out'/x(month6).
19942 print outfile='month-out.out'/x(month7).
19943 print outfile='month-out.out'/x(month8).
19944 print outfile='month-out.out'/x(month9).
19945 print outfile='month-out.out'/x(month10).
19946 print outfile='month-out.out'/x(month11).
19947 print outfile='month-out.out'/x(month12).
19948 print outfile='month-out.out'/x(month13).
19949 print outfile='month-out.out'/x(month14).
19950 print outfile='month-out.out'/x(month15).
19951 print outfile='month-out.out'/x(month16).
19952 print outfile='month-out.out'/x(month17).
19953 print outfile='month-out.out'/x(month18).
19954 print outfile='month-out.out'/x(month19).
19955 print outfile='month-out.out'/x(month20).
19956 print outfile='month-out.out'/x(month21).
19957 print outfile='month-out.out'/x(month22).
19958 print outfile='month-out.out'/x(month23).
19959 print outfile='month-out.out'/x(month24).
19960 print outfile='month-out.out'/x(month25).
19961 print outfile='month-out.out'/x(month26).
19962 print outfile='month-out.out'/x(month27).
19963 print outfile='month-out.out'/x(month28).
19964 print outfile='month-out.out'/x(month29).
19965 print outfile='month-out.out'/x(month30).
19966 print outfile='month-out.out'/x(month31).
19967 print outfile='month-out.out'/x(month32).
19968 print outfile='month-out.out'/x(month33).
19969 print outfile='month-out.out'/x(month34).
19970 print outfile='month-out.out'/x(month35).
19971 print outfile='month-out.out'/x(month36).
19972 print outfile='month-out.out'/x(month37).
19973 print outfile='month-out.out'/x(month38).
19974 print outfile='month-out.out'/x(month39).
19975 print outfile='month-out.out'/x(month40).
19978 AT_CHECK([pspp -O format=csv month-out.sps], [1], [stdout])
19979 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
19981 38 error: Month number 0.000000 is not between 1 and 12.
19982 38 error: Month number 0.500000 is not between 1 and 12.
19983 38 error: Month number 0.900000 is not between 1 and 12.
19984 38 error: Month number 13.000000 is not between 1 and 12.
19986 AT_CHECK([cat month-out.out], [0], [dnl
20864 AT_SETUP([WKDAY output])
20865 AT_KEYWORDS([data-out])
20866 AT_DATA([wkday-out.sps], [dnl
20867 set mxwarns=10000000.
20868 set mxerrs=10000000.
20869 data list notable/x 1-10.
20890 do repeat format=wkday2 to wkday40.
20891 print outfile='wkday-out.out'/x(format).
20895 AT_CHECK([pspp -O format=csv wkday-out.sps], [1], [stdout])
20896 AT_CHECK([[sed '/^ *
\r*$/d' stdout | sort | uniq -c | sed 's/^[ ]*//']], [0],
20898 39 error: Weekday number 0.000000 is not between 1 and 7.
20899 39 error: Weekday number 0.500000 is not between 1 and 7.
20900 39 error: Weekday number 0.900000 is not between 1 and 7.
20901 39 error: Weekday number 8.000000 is not between 1 and 7.
20903 AT_CHECK([cat wkday-out.out], [0], [dnl
21609 dnl This checks for a regression where AHEX output would crash due to
21610 dnl dereferencing string data as a pointer, for string widths between
21611 dnl 5 and 8, inclusive.
21612 AT_SETUP([AHEX output bug])
21613 AT_KEYWORDS([data-out])
21614 AT_DATA([ahex.sps], [
21615 DATA LIST NOTABLE /s (a8).
21619 FORMATS s (AHEX16).
21622 AT_CHECK([pspp -O format=csv ahex.sps], [0], [dnl