diff options
author | Nicholas Clark <nick@ccl4.org> | 2001-01-17 17:31:33 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-17 18:37:13 +0000 |
commit | 853d5ea7bf8844627e3f129eaa752c819a941d65 (patch) | |
tree | 7b87ecb44a126ad3d699e18bf49cbbaccf4b96c0 /t/op | |
parent | 2d9af89dd69923cdedca6ec04a8cd5e5134b0c0b (diff) | |
download | perl-853d5ea7bf8844627e3f129eaa752c819a941d65.tar.gz |
Re: [PATCH: perl@8429] lib/tie-substrhash.t FAILED at test 11
Message-ID: <20010117173133.I2633@plum.flirble.org>
p4raw-id: //depot/perl@8465
Diffstat (limited to 't/op')
-rwxr-xr-x | t/op/int.t | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/t/op/int.t b/t/op/int.t index 7d675a4291..e9596a39a0 100755 --- a/t/op/int.t +++ b/t/op/int.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..7\n"; +print "1..14\n"; # compile time evaluation @@ -34,3 +34,65 @@ print $x == -7 ? "ok 5\n" : "# expected -7, got $x\nnot ok 5\n"; @x = ( 6, 8, 10); print "not " if $x["1foo"] != 8; print "ok 7\n"; + +# check values > 32 bits work. + +$x = 4294967303.15; +$y = int ($x); + +if ($y eq "4294967303") { + print "ok 8\n" +} else { + print "not ok 8 # int($x) is $y, not 4294967303\n" +} + +$y = int (-$x); + +if ($y eq "-4294967303") { + print "ok 9\n" +} else { + print "not ok 9 # int($x) is $y, not -4294967303\n" +} + +$x = 4294967294.2; +$y = int ($x); + +if ($y eq "4294967294") { + print "ok 10\n" +} else { + print "not ok 10 # int($x) is $y, not 4294967294\n" +} + +$x = 4294967295.7; +$y = int ($x); + +if ($y eq "4294967295") { + print "ok 11\n" +} else { + print "not ok 11 # int($x) is $y, not 4294967295\n" +} + +$x = 4294967296.11312; +$y = int ($x); + +if ($y eq "4294967296") { + print "ok 12\n" +} else { + print "not ok 12 # int($x) is $y, not 4294967296\n" +} + +$y = int(279964589018079/59); +if ($y == 4745162525730) { + print "ok 13\n" +} else { + print "not ok 13 # int(279964589018079/59) is $y, not 4745162525730\n" +} + +$y = 279964589018079; +$y = int($y/59); +if ($y == 4745162525730) { + print "ok 14\n" +} else { + print "not ok 14 # int(279964589018079/59) is $y, not 4745162525730\n" +} + |