summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2004-03-10 22:45:48 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-03-18 20:33:02 +0000
commit4fe3f0fa0e8a231fc577c0b8520dc57000b1e088 (patch)
tree584659c47cfdbe8b346ef180dd5711dabb4cf415 /t
parent5ab053b06800167d2bc083dd4186b23d7cb95fce (diff)
downloadperl-4fe3f0fa0e8a231fc577c0b8520dc57000b1e088.tar.gz
range operator warnings / 64-bit fix
Message-Id: <20040310214548.4f5e3ab1@r2d2> p4raw-id: //depot/perl@22532
Diffstat (limited to 't')
-rwxr-xr-xt/op/range.t26
1 files changed, 22 insertions, 4 deletions
diff --git a/t/op/range.t b/t/op/range.t
index ce9bbf675b..310f4805d7 100755
--- a/t/op/range.t
+++ b/t/op/range.t
@@ -1,5 +1,12 @@
#!./perl
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+use Config;
+
print "1..37\n";
print join(':',1..5) eq '1:2:3:4:5' ? "ok 1\n" : "not ok 1\n";
@@ -47,12 +54,23 @@ print "not " unless join(",", @y) eq join(",", @x);
print "ok 10\n";
# check bounds
-@a = 0x7ffffffe..0x7fffffff;
-print "not " unless "@a" eq "2147483646 2147483647";
+if ($Config{ivsize} == 8) {
+ @a = eval "0x7ffffffffffffffe..0x7fffffffffffffff";
+ $a = "9223372036854775806 9223372036854775807";
+ @b = eval "-0x7fffffffffffffff..-0x7ffffffffffffffe";
+ $b = "-9223372036854775807 -9223372036854775806";
+}
+else {
+ @a = eval "0x7ffffffe..0x7fffffff";
+ $a = "2147483646 2147483647";
+ @b = eval "-0x7fffffff..-0x7ffffffe";
+ $b = "-2147483647 -2147483646";
+}
+
+print "not " unless "@a" eq $a;
print "ok 11\n";
-@a = -0x7fffffff..-0x7ffffffe;
-print "not " unless "@a" eq "-2147483647 -2147483646";
+print "not " unless "@b" eq $b;
print "ok 12\n";
# check magic