Skip to content

Commit

Permalink
fix tests on 32 bit machines
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed May 1, 2021
1 parent 29e1d93 commit e76c22b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
@@ -1 +1,3 @@
0.0.2 2020-05-01 Fix tests on 32 bit machines

0.0.1 2020-05-01 Initial release
2 changes: 1 addition & 1 deletion lib/Scalar/Type.pm
Expand Up @@ -7,7 +7,7 @@ use Scalar::Util qw(blessed);

use base qw(Exporter);

our $VERSION = '0.0.1';
our $VERSION = '0.0.2';

=head1 NAME
Expand Down
18 changes: 13 additions & 5 deletions t/all.t
Expand Up @@ -57,11 +57,19 @@ subtest "integers written as exponents are weird" => sub {
ok(is_number(-1e10), '... but it is a number');

my $foo = 1e10; $foo += 0;
ok(is_integer($foo), '1e10 + 0 is an integer');
$foo = 0; $foo += 1e10;
ok(is_integer($foo), '0 + 1e10 is an integer');
$foo = -1e10; $foo += 0;
ok(is_integer($foo), '-1e10 + 0 is an integer');
if(~0 < $foo) { # 32 bit system
ok(!is_integer($foo), '1e10 + 0 is not an integer because your computer is pathetic');
$foo = 0; $foo += 1e10;
ok(!is_integer($foo), '0 + 1e10 is not an integer because your computer is pathetic');
$foo = -1e10; $foo += 0;
ok(!is_integer($foo), '-1e10 + 0 is not an integer because your computer is pathetic');
} else {
ok(is_integer($foo), '1e10 + 0 is an integer');
$foo = 0; $foo += 1e10;
ok(is_integer($foo), '0 + 1e10 is an integer');
$foo = -1e10; $foo += 0;
ok(is_integer($foo), '-1e10 + 0 is an integer');
}
};
subtest "64 bit-unfriendly exp ints" => sub {
ok(!is_integer(1e20), '1e20 is not an integer');
Expand Down

0 comments on commit e76c22b

Please sign in to comment.