6 BEGIN { $ENV{PERL_TEST_LEANER_USES_TEST_MORE} = 1 }
12 if ($INC{'Test/More.pm'}) {
19 Test::More::plan(tests => 1 + 4 * 15 + 3 * 3 + 2 * 8);
20 Test::More::is($loaded, 1, 'Test::More has been loaded');
24 my ($stash, $name) = @_;
26 my $glob = $stash->{$name};
27 return undef unless $glob;
32 my $leaner_stash = \%Test::Leaner::;
33 my $more_stash = \%Test::More::;
34 my $this_stash = \%main::;
55 my $more_variant = get_subroutine($more_stash, $_);
57 my $leaner_variant = get_subroutine($leaner_stash, $_);
58 Test::More::ok(defined $leaner_variant,
59 "Test::Leaner variant of $_ is defined");
60 my $imported_variant = get_subroutine($this_stash, $_);
61 Test::More::ok(defined $imported_variant, "imported variant of $_ is defined");
64 Test::More::skip('Need leaner and imported variants to be defined' => 2)
65 unless defined $leaner_variant
66 and defined $imported_variant;
68 if (defined $more_variant) {
69 Test::More::is($leaner_variant, $more_variant,
70 "Test::Leaner variant of $_ is Test::More variant");
71 Test::More::is($imported_variant, $more_variant,
72 "imported variant of $_ is Test::More variant");
74 Test::More::is($imported_variant, $leaner_variant,
75 "imported variant of $_ is Test::Leaner variant");
78 eval { $leaner_variant->() };
79 Test::More::like($@, qr/^\Q$_\E is not implemented.*at \Q$0\E line \d+/,
80 "Test::Leaner of $_ variant croaks");
86 my @only_in_test_leaner = qw<
92 for (@only_in_test_leaner) {
93 Test::More::ok(exists $leaner_stash->{$_},
94 "$_ still exists in Test::Leaner");
95 Test::More::ok(!exists $more_stash->{$_},
96 "$_ was not imported into Test::More");
97 Test::More::ok(!exists $this_stash->{$_},
98 "$_ was not imported into main");
101 my @only_in_test_more = qw<
112 for (@only_in_test_more) {
113 my $more_variant = get_subroutine($more_stash, $_);
116 Test::More::skip("$_ is not implemented in this version of Test::More" => 2)
117 unless defined $more_variant;
119 Test::More::ok(!exists $leaner_stash->{$_},
120 "$_ was not imported into Test::Leaner");
121 Test::More::ok(!exists $this_stash->{$_},
122 "$_ was not imported into main");