7 require Config; import Config;
8 keys %Config; # Silence warning
9 if ($Config{extensions} !~ /\bList\/Util\b/) {
10 print "1..0 # Skip: List::Util was not built\n";
17 use Test::More tests => 12;
18 use Scalar::Util qw(looks_like_number);
20 foreach my $num (qw(1 -1 +1 1.0 +1.0 -1.0 -1.0e-12)) {
21 ok(looks_like_number($num), "'$num'");
24 is(!!looks_like_number("Inf"), $] >= 5.006001, 'Inf');
25 is(!!looks_like_number("Infinity"), $] >= 5.008, 'Infinity');
26 is(!!looks_like_number("NaN"), $] >= 5.008, 'NaN');
27 is(!!looks_like_number("foo"), '', 'foo');
28 is(!!looks_like_number(undef), $] < 5.009002, 'undef');
30 # We should copy some of perl core tests like t/base/num.t here