ok $ret, 'ok(true) returns true';
{
- package Test::Leaner::TestOverload::AlwaysFalse;
+ package Test::Leaner::TestOverload::AlwaysTrue;
- use overload 'bool' => sub { 1 };
+ use overload (
+ 'bool' => sub { 1 },
+ '""' => sub { '' },
+ );
sub new { bless { }, shift }
}
-my $z = Test::Leaner::TestOverload::AlwaysFalse->new;
+my $z = Test::Leaner::TestOverload::AlwaysTrue->new;
ok $z, 'ok($overloaded_true)';
{
package Test::Leaner::TestOverload::AlwaysFalse;
- use overload 'bool' => sub { !1 };
+ use overload (
+ 'bool' => sub { !1 },
+ '""' => sub { 'true' },
+ );
sub new { bless { }, shift }
}