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
}
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;
}
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"};
}