Skip to content

Commit

Permalink
more random prodding
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed May 5, 2021
1 parent ebe0e05 commit 1e7d3a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WriteMakefile(
'Test::More' => 0.96,
'Devel::Peek' => 0,
'Capture::Tiny' => 0,
'Devel::CheckOS' => 0,
},
realclean => {
FILES => "_Inline"
Expand Down
9 changes: 5 additions & 4 deletions t/all.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use Test::More;
use Scalar::Type qw(is_* type);
use B;
use Capture::Tiny qw(capture_stderr);
use Devel::CheckOS qw(os_is);
use Devel::Peek;

subtest "is_integer" => sub {
Expand Down Expand Up @@ -96,22 +97,22 @@ subtest "string subsequently used as an int or float" => sub {
$foo < 8;
ok($foo eq '007', "after being treated as an int it still has its original value");
is(type($foo), 'SCALAR', "and it's not become an integer as far as we're concerned");
note(capture_stderr { Dump($foo) });
note(capture_stderr { Dump($foo) }) unless(os_is('MicrosoftWindows'));
};

subtest "'007.5'" => sub {
my $foo = "007.5";
$foo + 0.5;
ok($foo eq '007.5', "after being treated as a float it still has its original value");
is(type($foo), 'SCALAR', "and it's not become a float as far as we're concerned");
note(capture_stderr { Dump($foo) });
note(capture_stderr { Dump($foo) }) unless(os_is('MicrosoftWindows'));
};

subtest "'7'" => sub {
my $foo = '7';
$foo < 8;
is(type($foo), 'INTEGER', "this does become an int after a numeric operation");
note(capture_stderr { Dump($foo) });
note(capture_stderr { Dump($foo) }) unless(os_is('MicrosoftWindows'));
};
};

Expand All @@ -130,7 +131,7 @@ subtest "are we checking the flags, not just the contents of the IV/NV slots?" =
ok(!is_integer($foo), 'variable is no longer an int after a string was assigned to it');
ok(!is_number($foo), '... no longer a number either');
note("still says 42 in the IV slot, but IOK isn't set");
note(capture_stderr { Dump($foo) });
note(capture_stderr { Dump($foo) }) unless(os_is('MicrosoftWindows'));

$foo = 3.14;
ok(!is_integer($foo), 'variable containing 3.14 is not an integer');
Expand Down

0 comments on commit 1e7d3a8

Please sign in to comment.