From: Vincent Pit Date: Fri, 24 Dec 2010 17:21:08 +0000 (+0100) Subject: Better variable names X-Git-Tag: v0.01~24 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=627cfc1e101ffcd0a1e0039e7eb333d5efd15d8a;p=perl%2Fmodules%2FTest-Leaner.git Better variable names --- diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index a022c92..d88ecf6 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -295,8 +295,8 @@ BEGIN { local $@; eval <<"IS_BINOP"; sub is_$name (\$\$;\$) { - my (\$x, \$y, \$desc) = \@_; - \@_ = ((\$x $op \$y), \$desc); + my (\$got, \$expected, \$desc) = \@_; + \@_ = ((\$got $op \$expected), \$desc); goto &ok; } IS_BINOP @@ -315,10 +315,10 @@ sub is ($$;$) { } sub isnt ($$;$) { - my ($x, $y, $desc) = @_; + my ($got, $expected, $desc) = @_; no warnings 'uninitialized'; @_ = ( - ((defined $x xor defined $y) or $x ne $y), + ((defined $got xor defined $expected) or $got ne $expected), $desc, ); goto &ok; @@ -331,10 +331,10 @@ sub isnt ($$;$) { } sub cmp_ok ($$$;$) { - my ($x, $op, $y, $desc) = @_; + my ($got, $op, $expected, $desc) = @_; my $name = $binops{$op}; croak("Operator $op not supported") unless defined $name; - @_ = ($x, $y, $desc); + @_ = ($got, $expected, $desc); no strict 'refs'; goto &{__PACKAGE__."::is_$name"}; }