$self->name->overload::OVERLOAD($op => $body);
}
+sub remove_overloaded_operator {
+ my $self = shift;
+ my ($op) = @_;
+ # ugh, overload.pm provides no api for this
+ $self->get_or_add_package_symbol('%OVERLOAD')->{dummy}++;
+ $self->remove_package_symbol('&(' . $op);
+}
+
sub _get_overloaded_operator_body {
my $self = shift;
my ($op) = @_;
is($minus, 0);
is(Foo::Overloaded->new - Foo::Overloaded->new, "minus");
is($minus, 1);
+
+ $meta->remove_overloaded_operator('-');
+
+ like(exception { Foo::Overloaded->new - Foo::Overloaded->new },
+ qr/Operation "-": no method found/);
}
done_testing;