Hi All

Accidentally I've found a bug in Assert.pm:

    my ($expected, $actual) = ('1foo', '1bar');
    $self->assert_equals($expected, $actual);

The code above will not generate a failure. I traced module source, and found that the reason is in is_numeric():

sub is_numeric {
    my $str = shift;
    local $^W;
    return defined $str && ! ($str == 0 && $str !~ /[+-]?0(e0)?/);
}

for (qw(123foo 123 foo)) {
    print "$_ is numeric\n" if is_numeric($_) ;
}

__OUTPUT__
123foo is numeric
123 is numeric

At the same time, assert_str_equals does it's job.

Best regards,
Dmitry.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Perlunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/perlunit-users

Reply via email to