use Test::More;
use Test::Fatal;
+my $quote = qr/['`"]/;
+
{
package Foo;
use Moose;
my $minus_impl = sub { $minus = 1; "minus" };
like(exception { Foo::Overloaded->new - Foo::Overloaded->new },
- qr/Operation "-": no method found/);
+ qr/Operation $quote-$quote: no method found/);
$meta->add_overloaded_operator('-' => $minus_impl);
$meta->remove_overloaded_operator('-');
like(exception { Foo::Overloaded->new - Foo::Overloaded->new },
- qr/Operation "-": no method found/);
+ qr/Operation $quote-$quote: no method found/);
}
my $times = 0;
is($times, 1);
like(exception { Foo::OverloadedMethod->new / Foo::OverloadedMethod->new },
- qr{Operation "/": no method found});
+ qr{Operation $quote/$quote: no method found});
$meta->add_overloaded_operator('/' => 'divided');
$meta->remove_overloaded_operator('/');
like(exception { Foo::OverloadedMethod->new / Foo::OverloadedMethod->new },
- qr{Operation "/": no method found});
+ qr{Operation $quote/$quote: no method found});
}
done_testing;