]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blobdiff - t/20-ok.t
Fall back to Test::More when PERL_TEST_LEANER_USES_TEST_MORE is set
[perl/modules/Test-Leaner.git] / t / 20-ok.t
index 9bc35ad8e3debe17859867757bd38332db16d38d..19e989a0a2ecaf57d4d7b4b4265cd43d35a0d83c 100644 (file)
--- a/t/20-ok.t
+++ b/t/20-ok.t
@@ -3,7 +3,9 @@
 use strict;
 use warnings;
 
-use Test::Leaner tests => 4 + 1;
+BEGIN { delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE} }
+
+use Test::Leaner tests => 4 + 1 + 2 + 1;
 
 ok 1;
 ok !!1,    'ok() test with a description';
@@ -12,3 +14,18 @@ ok +{},    'a hash ref is fine too';
 
 my @array = (undef);
 ok @array, 'ok() forces scalar context';
+
+my $ret = ok 1;
+ok $ret, 'ok(true) returns true';
+
+{
+ package Test::Leaner::TestOverload::AlwaysFalse;
+
+ use overload 'bool' => sub { 1 };
+
+ sub new { bless { }, shift }
+}
+
+my $z = Test::Leaner::TestOverload::AlwaysFalse->new;
+
+ok $z, 'ok($overloaded_true)';