]>
Commit | Line | Data |
---|---|---|
cfee166d JS |
1 | #!/usr/bin/perl -w |
2 | # | |
3 | # Prints test formats for wxFormatConverter. The output is in two columns (tab | |
4 | # separated), the first is the test input and the second is the expected | |
5 | # output. | |
6 | # | |
7 | # run the output thought formattest like this: | |
8 | # ./formats.pl | ./formattest | |
9 | # | |
10 | use strict; | |
11 | ||
12 | my %transform = ( | |
13 | s => [ 'l', 's' ], | |
14 | S => [ '', 's' ], | |
15 | hS => [ '', 's' ], | |
16 | lS => [ 'l', 's' ], | |
17 | c => [ 'l', 'c' ], | |
18 | C => [ '', 'c' ], | |
19 | hC => [ '', 'c' ], | |
20 | lC => [ 'l', 'c' ] | |
21 | ); | |
22 | ||
23 | print "%%\t%%\n"; | |
24 | ||
25 | for my $type ('d', 's', 'S', 'c', 'C') | |
26 | { | |
27 | for my $mod ('', 'h', 'l', 'hh', 'll', 'j') #, 'z', 't', 'L') | |
28 | { | |
29 | for my $prec ('', '.*', '.10') | |
30 | { | |
31 | for my $width ('', '*', '10') | |
32 | { | |
33 | for my $flag ('', '#') #, '0', '-', ' ', '+' ) | |
34 | { | |
35 | my ($newmod, $newtype) = ($mod, $type); | |
36 | ||
37 | if ($transform{$mod.$type}) { | |
38 | ($newmod, $newtype) = @{$transform{$mod.$type}}; | |
39 | } | |
40 | ||
41 | print "%$flag$width$prec$mod$type\t". | |
42 | "%$flag$width$prec$newmod$newtype\n"; | |
43 | } | |
44 | } | |
45 | } | |
46 | } | |
47 | } |