summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-07-16 09:05:00 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-07-16 09:05:00 +0000
commitaf8969e308ff97b0d65e618dac6677f02651310f (patch)
tree38148c547a9556a03f882bebb8bdccf76512c339 /t
parentb59de6b46a4e8c00eca08a7bad7cb695d5ea81d1 (diff)
parent4322f456c231b325334e8dc3c4f87b4eb1f04a50 (diff)
downloadperl-af8969e308ff97b0d65e618dac6677f02651310f.tar.gz
Integrate mainline
p4raw-id: //depot/perlio@11376
Diffstat (limited to 't')
-rwxr-xr-xt/op/pat.t16
-rwxr-xr-xt/op/sprintf.t28
2 files changed, 41 insertions, 3 deletions
diff --git a/t/op/pat.t b/t/op/pat.t
index 57dc2f24e1..99d9333a3f 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -6,7 +6,7 @@
$| = 1;
-print "1..672\n";
+print "1..674\n";
BEGIN {
chdir 't' if -d 't';
@@ -1929,3 +1929,17 @@ print "not " unless chr(0x38c) =~ /\p{InGreek}/; # singleton
print "ok 672\n";
+##
+## Test [:cntrl:]...
+##
+## Should probably put in tests for all the POSIX stuff, but not sure how to
+## guarantee a specific locale......
+##
+$AllBytes = join('', map { chr($_) } 0..255);
+($x = $AllBytes) =~ s/[[:cntrl:]]//g;
+if ($x ne join('', map { chr($_) } 0x20..0x7E, 0x80..0xFF)) { print "not " };
+print "ok 673\n";
+
+($x = $AllBytes) =~ s/[^[:cntrl:]]//g;
+if ($x ne join('', map { chr($_) } 0..0x1F, 0x7F)) { print "not " };
+print "ok 674\n";
diff --git a/t/op/sprintf.t b/t/op/sprintf.t
index f534812854..3ac559d2ac 100755
--- a/t/op/sprintf.t
+++ b/t/op/sprintf.t
@@ -11,6 +11,12 @@ BEGIN {
@INC = '../lib';
}
use warnings;
+# %Config is needed to obtain archname for VAX (since @INC is now insufficient)
+use Config;
+
+# strictness
+my @tests = ();
+my ($i, $template, $data, $result, $comment, $w, $x, $evalData, $n, $p);
while (<DATA>) {
s/^\s*>//; s/<\s*$//;
@@ -29,6 +35,13 @@ $SIG{__WARN__} = sub {
}
};
+my $Is_VMS_VAX = 0;
+# The redundant $^O check might help non VMS platforms avoid %Config load
+if ($^O eq 'VMS' &&
+ defined($Config{'archname'}) && $Config{'archname'} eq 'VMS_VAX') {
+ $Is_VMS_VAX = 1;
+}
+
for ($i = 1; @tests; $i++) {
($template, $data, $result, $comment) = @{shift @tests};
if ($^O eq 'os390' || $^O eq 's390') { # non-IEEE (s390 is UTS)
@@ -37,6 +50,14 @@ for ($i = 1; @tests; $i++) {
$data =~ s/([eE])\-101$/${1}-56/; # larger exponents
$result =~ s/([eE])\-102$/${1}-57/; # " "
}
+ if ($Is_VMS_VAX) { # VAX DEC C 5.3 at least since there is no
+ # ccflags =~ /float=ieee/ on VAX.
+ # AXP is unaffected whether or not it's using ieee.
+ $data =~ s/([eE])96$/${1}26/; # smaller exponents
+ $result =~ s/([eE]\+)102$/${1}32/; # " "
+ $data =~ s/([eE])\-101$/${1}-24/; # larger exponents
+ $result =~ s/([eE])\-102$/${1}-25/; # " "
+ }
$evalData = eval $data;
$w = undef;
$x = sprintf(">$template<",
@@ -135,13 +156,13 @@ __END__
>%L< >''< >%L INVALID<
>%M< >''< >%M INVALID<
>%N< >''< >%N INVALID<
->%O< >2**32-1< >37777777777< >Synonum for %lo<
+>%O< >2**32-1< >37777777777< >Synonym for %lo<
>%P< >''< >%P INVALID<
>%Q< >''< >%Q INVALID<
>%R< >''< >%R INVALID<
>%S< >''< >%S INVALID<
>%T< >''< >%T INVALID<
->%U< >2**32-1< >4294967295< >Synonum for %lu<
+>%U< >2**32-1< >4294967295< >Synonym for %lu<
>%V< >''< >%V INVALID<
>%W< >''< >%W INVALID<
>%X< >2**32-1< >FFFFFFFF< >Like %x, but with u/c letters<
@@ -287,6 +308,9 @@ __END__
>%o< >2**32-1< >37777777777<
>%+o< >2**32-1< >37777777777<
>%#o< >2**32-1< >037777777777<
+>%o< >642< >1202< >check smaller octals across platforms<
+>%+o< >642< >1202<
+>%#o< >642< >01202<
>%d< >$p=sprintf('%p',$p);$p=~/^[0-9a-f]+$/< >1< >Coarse hack: hex from %p?<
>%#p< >''< >%#p INVALID<
>%q< >''< >%q INVALID<