new diagnostic
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 1;
|
||||
use Test::More;
|
||||
use Mojo::IOLoop;
|
||||
|
||||
our $format;
|
||||
|
||||
my $loop = eval { Mojo::IOLoop->singleton };
|
||||
diag $@ if $@;
|
||||
ok $loop;
|
||||
diag ref eval { $loop->reactor };
|
||||
diag sprintf $format, 'mojo io loop', ref eval { $loop->reactor };
|
||||
diag $@ if $@;
|
||||
|
||||
1;
|
||||
51
t/00_diag.t
Normal file
51
t/00_diag.t
Normal file
@@ -0,0 +1,51 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 1;
|
||||
BEGIN { eval q{ use EV } }
|
||||
eval q{
|
||||
use FindBin ();
|
||||
use File::Spec;
|
||||
1;
|
||||
} || die $@;
|
||||
|
||||
pass 'okay';
|
||||
|
||||
my @modules;
|
||||
do {
|
||||
my $fh;
|
||||
open($fh, '<', File::Spec->catfile($FindBin::Bin, '00_diag.txt'));
|
||||
@modules = <$fh>;
|
||||
close $fh;
|
||||
chomp @modules;
|
||||
};
|
||||
|
||||
my $max = 1;
|
||||
$max = $_ > $max ? $_ : $max for map { length $_ } @modules;
|
||||
our $format = "%-${max}s %s";
|
||||
|
||||
diag '';
|
||||
diag '';
|
||||
diag '';
|
||||
|
||||
diag sprintf $format, 'perl ', $^V;
|
||||
|
||||
require(File::Spec->catfile($FindBin::Bin, '00_diag.pl'))
|
||||
if -e File::Spec->catfile($FindBin::Bin, '00_diag.pl');
|
||||
|
||||
foreach my $module (@modules)
|
||||
{
|
||||
if(eval qq{ use $module; 1 })
|
||||
{
|
||||
my $ver = eval qq{ \$$module\::VERSION };
|
||||
$ver = 'undef' unless defined $ver;
|
||||
diag sprintf $format, $module, $ver;
|
||||
}
|
||||
else
|
||||
{
|
||||
diag sprintf $format, $module, '-';
|
||||
}
|
||||
}
|
||||
|
||||
diag '';
|
||||
diag '';
|
||||
diag '';
|
||||
24
t/00_diag.txt
Normal file
24
t/00_diag.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Carp
|
||||
Cwd
|
||||
EV
|
||||
ExtUtils::MakeMaker
|
||||
File::Spec
|
||||
File::Temp
|
||||
FindBin
|
||||
IO::Handle
|
||||
IPC::Open3
|
||||
Mojo::Base
|
||||
Mojo::ByteStream
|
||||
Mojo::IOLoop
|
||||
Mojolicious
|
||||
Mojolicious::Lite
|
||||
Mojolicious::Plugin
|
||||
POSIX
|
||||
Scalar::Util
|
||||
Template
|
||||
Template::Provider
|
||||
Test::CPAN::Meta
|
||||
Test::Mojo
|
||||
Test::More
|
||||
lib
|
||||
utf8
|
||||
Reference in New Issue
Block a user