source:
trunk/essentials/dev-lang/perl/t/op/oct.t@
3298
| Last change on this file since 3298 was 3181, checked in by , 19 years ago | |
|---|---|
| File size: 4.2 KB | |
| Line | |
|---|---|
| 1 | #!./perl |
| 2 | |
| 3 | # tests 51 onwards aren't all warnings clean. (intentionally) |
| 4 | |
| 5 | print "1..71\n"; |
| 6 | |
| 7 | my $test = 1; |
| 8 | |
| 9 | sub test ($$$) { |
| 10 | my ($act, $string, $value) = @_; |
| 11 | my $result; |
| 12 | if ($act eq 'oct') { |
| 13 | $result = oct $string; |
| 14 | } elsif ($act eq 'hex') { |
| 15 | $result = hex $string; |
| 16 | } else { |
| 17 | die "Unknown action 'act'"; |
| 18 | } |
| 19 | if ($value == $result) { |
| 20 | if ($^O eq 'VMS' && length $string > 256) { |
| 21 | $string = ''; |
| 22 | } else { |
| 23 | $string = "\"$string\""; |
| 24 | } |
| 25 | print "ok $test # $act $string\n"; |
| 26 | } else { |
| 27 | my ($valstr, $resstr); |
