use warnings;
BEGIN {
- if ($^V ge v5.8.4 and $^V le v5.8.5) {
+ if ("$]" >= 5.008004 and "$]" <= 5.008005) {
require Test::More;
Test::More::plan(skip_all
=> 'goto may segfault randomly on perl 5.8.4 and 5.8.5');
Test::More::is($loaded, 1, 'Test::More has been loaded');
}
-sub get_subroutine {
- my ($stash, $name) = @_;
-
- my $glob = $stash->{$name};
- return undef unless $glob;
-
- return *$glob{CODE};
-}
-
-sub has_module_version {
- my ($module, $version) = @_;
-
- local $@;
- eval qq{
- require $module;
- "$module"->VERSION(\$version);
- 1;
- }
-}
-
-sub has_test_more_version { has_module_version 'Test::More', @_ }
+use lib 't/lib';
+use Test::Leaner::TestImport qw<
+ get_subroutine has_test_more_version default_exports
+>;
my $leaner_stash = \%Test::Leaner::;
my $more_stash = \%Test::More::;
my $this_stash = \%main::;
-my @exported = qw<
- plan
- skip
- done_testing
- pass
- fail
- ok
- is
- isnt
- like
- unlike
- cmp_ok
- is_deeply
- diag
- note
- BAIL_OUT
->;
+my @exported = default_exports;
for (@exported) {
my $more_variant = get_subroutine($more_stash, $_);