X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FLeaner.pm;h=a022c92bedc56565fc3b671e60705b995b3878ab;hb=1f18a8970afb90a780a29c9839e3ffee0bc2d5ba;hp=5e2f0a5f227e488256aa9677155c20763fe12a78;hpb=c966261ac55fcb079dfc1bf42b1152b4bb71bd0b;p=perl%2Fmodules%2FTest-Leaner.git diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index 5e2f0a5..a022c92 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -296,11 +296,7 @@ BEGIN { eval <<"IS_BINOP"; sub is_$name (\$\$;\$) { my (\$x, \$y, \$desc) = \@_; - no warnings 'uninitialized'; - \@_ = ( - (not(defined \$x xor defined \$y) and \$x $op \$y), - \$desc, - ); + \@_ = ((\$x $op \$y), \$desc); goto &ok; } IS_BINOP @@ -308,11 +304,14 @@ IS_BINOP } } -{ - no warnings 'once'; - *is = \&is_eq; - *like = \&is_like; - *unlike = \&is_unlike; +sub is ($$;$) { + my ($got, $expected, $desc) = @_; + no warnings 'uninitialized'; + @_ = ( + (not(defined $got xor defined $expected) and $got eq $expected), + $desc, + ); + goto &ok; } sub isnt ($$;$) { @@ -325,6 +324,12 @@ sub isnt ($$;$) { goto &ok; } +{ + no warnings 'once'; + *like = \&is_like; + *unlike = \&is_unlike; +} + sub cmp_ok ($$$;$) { my ($x, $op, $y, $desc) = @_; my $name = $binops{$op};