Skip to content

Commit

Permalink
perlimports -i t
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Sep 2, 2024
1 parent 724607d commit c9f5393
Show file tree
Hide file tree
Showing 68 changed files with 132 additions and 145 deletions.
4 changes: 1 addition & 3 deletions t/00_setup.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ use lib 't/lib';
use CPAN::Faker 0.010 ();
use Devel::Confess;
use MetaCPAN::Script::Tickets ();
use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw(
use MetaCPAN::TestHelpers qw(
fakecpan_configs_dir
fakecpan_dir
get_config
tmp_dir
write_find_ls
);
use MetaCPAN::TestServer ();
use Module::Faker 0.015 (); # Generates META.json.
use Test::More 0.96;
use URI::FromHash qw( uri );

Expand Down
6 changes: 3 additions & 3 deletions t/01_darkpan.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use warnings;
use lib 't/lib';

use Devel::Confess;
use MetaCPAN::DarkPAN ();
use MetaCPAN::TestServer;
use MetaCPAN::Tests::Controller::Search::DownloadURL;
use MetaCPAN::DarkPAN ();
use MetaCPAN::TestServer ();
use MetaCPAN::Tests::Controller::Search::DownloadURL ();
use Test::More;
use Test::RequiresInternet ( 'cpan.metacpan.org' => 80 );

Expand Down
3 changes: 1 addition & 2 deletions t/api/controller/cover.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use Mojo::Base -strict;

use lib 't/lib';

use MetaCPAN::Model::Search ();
use MetaCPAN::TestServer ();
use MetaCPAN::TestServer ();
use Test::More;
use Test::Mojo ();

Expand Down
11 changes: 5 additions & 6 deletions t/lib/MetaCPAN/DarkPAN.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package MetaCPAN::DarkPAN;

use MetaCPAN::Moose;

use CPAN::Repository::Perms;
use MetaCPAN::TestHelpers qw( get_config write_find_ls );
use CPAN::Repository::Perms ();
use MetaCPAN::TestHelpers qw( write_find_ls );
use MetaCPAN::Types::TypeTiny qw( Path );
use MetaCPAN::Util qw( author_dir );
use OrePAN2::Indexer;
use OrePAN2::Injector;
use Path::Tiny qw( path );
use URI::FromHash qw( uri_object );
use OrePAN2::Indexer ();
use OrePAN2::Injector ();
use URI::FromHash qw( uri_object );

has base_dir => (
is => 'ro',
Expand Down
6 changes: 3 additions & 3 deletions t/lib/MetaCPAN/Server/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package MetaCPAN::Server::Test;
use strict;
use warnings;

use HTTP::Request::Common qw(POST GET DELETE);
use HTTP::Request::Common qw( DELETE GET POST );
use MetaCPAN::Server ();
use Plack::Test;
use Plack::Test qw( test_psgi );
use Test::More;

use base 'Exporter';
Expand Down Expand Up @@ -37,7 +37,7 @@ sub app {
return $app;
}

require MetaCPAN::Model;
use MetaCPAN::Model ();

sub model {
MetaCPAN::Model->new( es => ( $ENV{ES_TEST} ||= 'localhost:9200' ) );
Expand Down
18 changes: 9 additions & 9 deletions t/lib/MetaCPAN/TestHelpers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ use warnings;
package # no_index
MetaCPAN::TestHelpers;

use Cpanel::JSON::XS;
use File::Copy qw( copy );
use File::pushd qw( pushd );
use FindBin;
use MetaCPAN::Util qw( checkout_root );
use MetaCPAN::Script::Runner;
use Path::Tiny qw( path );
use Cpanel::JSON::XS qw( decode_json encode_json );
use File::Copy qw( copy );
use File::pushd qw( pushd );
use FindBin ();
use MetaCPAN::Util qw( checkout_root );
use MetaCPAN::Script::Runner ();
use Path::Tiny qw( path );
use Test::More;
use Test::Routine::Util;
use Try::Tiny qw( catch try );
use Test::Routine::Util qw( run_tests );
use Try::Tiny qw( catch finally try );

use base 'Exporter';
our @EXPORT = qw(
Expand Down
35 changes: 17 additions & 18 deletions t/lib/MetaCPAN/TestServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ package MetaCPAN::TestServer;

use MetaCPAN::Moose;

use MetaCPAN::DarkPAN ();
use MetaCPAN::Script::Author ();
use MetaCPAN::Script::Cover ();
use MetaCPAN::Script::CPANTestersAPI ();
use MetaCPAN::Script::Favorite ();
use MetaCPAN::Script::First ();
use MetaCPAN::Script::Latest ();
use MetaCPAN::Script::Mapping ();
use MetaCPAN::Script::Mapping::Cover ();
use MetaCPAN::Script::Mirrors ();
use MetaCPAN::Script::Package ();
use MetaCPAN::Script::Permission ();
use MetaCPAN::Script::Release ();
use MetaCPAN::Server ();
use MetaCPAN::TestHelpers qw( fakecpan_dir );
use MetaCPAN::Types::TypeTiny qw( Path HashRef Str );
use Search::Elasticsearch;
use Search::Elasticsearch::TestServer;
use MetaCPAN::Script::Author ();
use MetaCPAN::Script::Cover ();
use MetaCPAN::Script::CPANTestersAPI ();
use MetaCPAN::Script::Favorite ();
use MetaCPAN::Script::First ();
use MetaCPAN::Script::Latest ();
use MetaCPAN::Script::Mapping ();
use MetaCPAN::Script::Mapping::Cover ();
use MetaCPAN::Script::Mirrors ();
use MetaCPAN::Script::Package ();
use MetaCPAN::Script::Permission ();
use MetaCPAN::Script::Release ();
use MetaCPAN::Server ();
use MetaCPAN::TestHelpers qw( fakecpan_dir );
use MetaCPAN::Types::TypeTiny qw( HashRef Path Str );
use Search::Elasticsearch ();
use Search::Elasticsearch::TestServer ();
use Test::More;
use Try::Tiny qw( catch try );

Expand Down
4 changes: 2 additions & 2 deletions t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package MetaCPAN::Tests::Controller::Search::DownloadURL;
use strict;
use warnings;

use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers;
use MetaCPAN::Server::Test qw( app GET test_psgi );
use MetaCPAN::TestHelpers qw( decode_json_ok );
use Moose;
use Test::More;

Expand Down
2 changes: 1 addition & 1 deletion t/lib/MetaCPAN/Tests/Model.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use Test::Routine;
use MetaCPAN::Server::Test ();
use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRef Str );
use Test::More;
use Try::Tiny qw( catch try );
use Try::Tiny qw( try );

with qw(
MetaCPAN::Tests::Extra
Expand Down
4 changes: 2 additions & 2 deletions t/lib/MetaCPAN/Tests/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use Test::Routine;

use version;

use HTTP::Request::Common;
use List::Util ();
use HTTP::Request::Common qw( GET );
use List::Util ();
use Test::More;
use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRef Str );

Expand Down
6 changes: 3 additions & 3 deletions t/lib/MetaCPAN/Tests/UserAgent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ package MetaCPAN::Tests::UserAgent;
use Test::Routine;
use Test::More;

use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Request;
use LWP::UserAgent ();
use HTTP::Cookies ();
use HTTP::Request ();

has cb => (
is => 'ro',
Expand Down
2 changes: 1 addition & 1 deletion t/lib/Module/Faker/Dist/WithPerl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package # no_index
use Moose;
extends 'Module::Faker::Dist';

use Encode;
use Encode qw( encode_utf8 );

around append_for => sub {
my ( $orig, $self, $filename ) = @_;
Expand Down
4 changes: 2 additions & 2 deletions t/model/archive.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use lib 't/lib';
use Digest::SHA qw( sha1_hex );
use MetaCPAN::TestHelpers qw( fakecpan_dir );
use Test::More;
use Test::Fatal;
use Test::Deep qw(cmp_bag);
use Test::Fatal qw( exception );
use Test::Deep qw( cmp_bag );

my $CLASS = 'MetaCPAN::Model::Archive';
require_ok $CLASS;
Expand Down
3 changes: 1 addition & 2 deletions t/model/release.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use lib 't/lib';
use File::Temp ();
use LWP::Simple qw( getstore );
use MetaCPAN::Model::Release ();
use MetaCPAN::Script::Runner;
use MetaCPAN::TestHelpers qw( get_config );
use MetaCPAN::TestHelpers qw( get_config );
use Test::More;
use Test::RequiresInternet( 'metacpan.org' => 'https' );

Expand Down
5 changes: 2 additions & 3 deletions t/model/release/dependencies.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ use warnings;
use lib 't/lib';

use MetaCPAN::Model::Release ();
use MetaCPAN::Script::Runner;
use MetaCPAN::TestHelpers qw( fakecpan_dir get_config );
use MetaCPAN::TestHelpers qw( fakecpan_dir get_config );
use Test::More;
use Test::Deep qw(cmp_bag);
use Test::Deep qw( cmp_bag );

my $config = get_config();

Expand Down
3 changes: 2 additions & 1 deletion t/model/release/reverse_dependencies.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use warnings;
use lib 't/lib';

use MetaCPAN::Server ();

use Test::More;

my $c = 'MetaCPAN::Server';
my $c = MetaCPAN::Server::;

subtest 'distribution reverse_dependencies' => sub {
my $data = [
Expand Down
2 changes: 1 addition & 1 deletion t/package.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use warnings;
use lib 't/lib';

use Test::More;
use MetaCPAN::Script::Runner;
use MetaCPAN::Script::Runner ();

local @ARGV = ('package');

Expand Down
2 changes: 1 addition & 1 deletion t/permission.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use warnings;
use lib 't/lib';

use Test::More;
use MetaCPAN::Script::Runner;
use MetaCPAN::Script::Runner ();

local @ARGV = ('permission');

Expand Down
1 change: 0 additions & 1 deletion t/release/bugs.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw( test_distribution );
use Test::More;

Expand Down
2 changes: 1 addition & 1 deletion t/release/documentation-hide.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( model );
use Test::More;

my $model = model();
Expand Down
1 change: 0 additions & 1 deletion t/release/documentation-not-readme.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw( test_release );
use Test::More;

Expand Down
2 changes: 1 addition & 1 deletion t/release/file-changes.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( model );
use Test::More;

my $model = model();
Expand Down
3 changes: 1 addition & 2 deletions t/release/file-duplicates.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use Cpanel::JSON::XS ();
use MetaCPAN::Server::Test;
use Cpanel::JSON::XS ();
use MetaCPAN::TestHelpers qw( test_release );
use Test::More;

Expand Down
1 change: 0 additions & 1 deletion t/release/meta-license.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw( test_release );
use Test::More;

Expand Down
1 change: 0 additions & 1 deletion t/release/meta-provides.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::TestHelpers qw( test_release );
use Test::More;

Expand Down
2 changes: 1 addition & 1 deletion t/release/moose.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( model );
use Test::More;

my $model = model();
Expand Down
2 changes: 1 addition & 1 deletion t/release/multiple-modules.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( model );
use Test::More;

my $model = model();
Expand Down
2 changes: 1 addition & 1 deletion t/release/p-1.0.20.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use MetaCPAN::TestHelpers qw( test_release );
use Ref::Util qw( is_hashref );
use Test::More;

use MetaCPAN::TestServer;
use MetaCPAN::TestServer ();

my $server = MetaCPAN::TestServer->new;
$server->index_cpantesters;
Expand Down
5 changes: 2 additions & 3 deletions t/release/packages-unclaimable.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use strict;
use warnings;
use lib 't/lib';

use Cpanel::JSON::XS ();
use List::Util qw( uniq );
use MetaCPAN::Server::Test;
use Cpanel::JSON::XS ();
use List::Util qw( uniq );
use MetaCPAN::TestHelpers qw( test_release );
use Module::Metadata ();
use Test::More;
Expand Down
3 changes: 1 addition & 2 deletions t/release/packages.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use Cpanel::JSON::XS ();
use MetaCPAN::Server::Test;
use Cpanel::JSON::XS ();
use MetaCPAN::TestHelpers qw( test_release );
use Test::More;

Expand Down
2 changes: 1 addition & 1 deletion t/release/perl-changes-file.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( model );
use Test::More;

my $model = model();
Expand Down
2 changes: 1 addition & 1 deletion t/release/pm-PL.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use strict;
use warnings;
use lib 't/lib';

use MetaCPAN::Server::Test;
use MetaCPAN::Server::Test qw( app GET model test_psgi );
use Test::More;

my $model = model();
Expand Down
Loading

0 comments on commit c9f5393

Please sign in to comment.