summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-09-07 16:04:20 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-09-07 16:04:20 +0000
commit868d6b85d6bf503d6539e10888e7a82a14e04712 (patch)
tree6c815aa1c40ff70a351b614a42fb220f77e872b0 /t/op
parent85af15682277b123928d42865f6a5d72fb8a7e13 (diff)
downloadperl-868d6b85d6bf503d6539e10888e7a82a14e04712.tar.gz
Guard against bad string->int conversion for quads.
p4raw-id: //depot/perl@7019
Diffstat (limited to 't/op')
-rw-r--r--t/op/64bitint.t19
1 files changed, 17 insertions, 2 deletions
diff --git a/t/op/64bitint.t b/t/op/64bitint.t
index 5cfb65acf6..19d2645d63 100644
--- a/t/op/64bitint.t
+++ b/t/op/64bitint.t
@@ -3,7 +3,7 @@
BEGIN {
eval { my $q = pack "q", 0 };
if ($@) {
- print "1..0\n# no 64-bit types\n";
+ print "1..0\n# Skip: no 64-bit types\n";
exit(0);
}
chdir 't' if -d 't';
@@ -16,7 +16,7 @@ BEGIN {
# 32+ bit integers don't cause noise
no warnings qw(overflow portable);
-print "1..52\n";
+print "1..55\n";
my $q = 12345678901;
my $r = 23456789012;
@@ -279,4 +279,19 @@ print "ok 51\n";
print "not " unless (sprintf "%u", ~0) eq '18446744073709551615';
print "ok 52\n";
+# If the 53..55 fail you have problems in the parser's string->int conversion,
+# see toke.c:scan_num().
+
+$q = -9223372036854775808;
+print "not " unless "$q" eq "-9223372036854775808";
+print "ok 53\n";
+
+$q = 9223372036854775807;
+print "not " unless "$q" eq "9223372036854775807";
+print "ok 54\n";
+
+$q = 18446744073709551615;
+print "not " unless "$q" eq "18446744073709551615";
+print "ok 55\n";
+
# eof