data-in: Convert tests for date formats to Autotest framework.
[pspp-builds.git] / tests / formats / num-out-decmp.pl
1 use strict;
2 use warnings 'all';
3
4 my (@line);
5 while (<>) {
6     if (my ($n) = /^\*(\d+)$/) {
7         for (1...$n) {
8             $line[1]++;
9             $line[3] = " $line[3]";
10             print ' ', join ('', @line), "\n";
11         }
12     } elsif (my ($suffix) = /^\$(.*)$/) {
13         for my $c (split ('', $suffix)) {
14             $line[1]++;
15             $line[4] .= $c;
16             print ' ', join ('', @line), "\n";
17         }
18     } elsif (my ($prefix) = /^\^(.*)$/) {
19         for my $c (split ('', $prefix)) {
20             $line[1]++;
21             $line[4] = "$c$line[4]";
22             print ' ', join ('', @line), "\n";
23         }
24     } else {
25         @line = /^([A-Z]+)(\d+)([^"]+")( *)([^%"]*)(%?")$/;
26         print " $_";
27     }
28 }