view release on metacpan or search on metacpan
t/00-report-prereqs.t view on Meta::CPAN
my $static_prereqs = do './t/00-report-prereqs.dd';
# Merge all prereqs (either with ::Prereqs or a hashref)
my $full_prereqs = _merge_prereqs(
( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
$static_prereqs
);
# Add dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
my $cpan_meta_error;
if ( $source && $HAS_CPAN_META
&& (my $meta = eval { CPAN::Meta->load_file($source) } )
) {
$full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
}
else {
$cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source)
$source = 'static metadata';
}
my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
# Add static includes into a fake section
for my $mod (@include) {
$req_hash->{other}{modules}{$mod} = 0;
}
for my $phase ( qw(configure build test runtime develop other) ) {
next unless $req_hash->{$phase};
next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
t/00-report-prereqs.t view on Meta::CPAN
my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
if ($prefix) {
my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
$have = "undef" unless defined $have;
push @reports, [$mod, $want, $have];
if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
if ( $have !~ /\A$lax_version_re\z/ ) {
push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
}
elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
push @dep_errors, "$mod version '$have' is not in required range '$want'";
}
}
}
else {
push @reports, [$mod, $want, "missing"];
if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
push @dep_errors, "$mod is not installed ($req_string)";
}
}
}
if ( @reports ) {
push @full_reports, "=== $title ===\n\n";
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
t/00-report-prereqs.t view on Meta::CPAN
push @full_reports, "\n";
}
}
}
if ( @full_reports ) {
diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
}
if ( $cpan_meta_error || @dep_errors ) {
diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n";
}
if ( $cpan_meta_error ) {
my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n";
}
if ( @dep_errors ) {
diag join("\n",
"\nThe following REQUIRED prerequisites were not satisfied:\n",
@dep_errors,
"\n"
);
}
pass('Reported prereqs');
# vim: ts=4 sts=4 sw=4 et:
t/classical_all.t view on Meta::CPAN
use Acme::Lingua::EN::Inflect::Modern qw(PL_N classical);
use Test::More 'no_plan';
# DEFAULT...
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brother's"; # classical others not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
# CLASSICAL PLURALS ACTIVATED...
classical "all";
is PL_N("error", 0) => "error"; # classical "zero" active
is PL_N("wildebeest") => "wildebeest"; # classical "herd" active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brethren"; # classical others active
is PL_N("person") => "person's"; # classical "persons" active
is PL_N("formula") => "formulae"; # classical "ancient" active
# CLASSICAL PLURALS DEACTIVATED...
classical all => 0;
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("Sally") => "Sally's"; # classical "names" not active
is PL_N("brother") => "brother's"; # classical others not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
# CLASSICAL PLURALS REACTIVATED...
classical all => 1;
is PL_N("error", 0) => "error"; # classical "zero" active
is PL_N("wildebeest") => "wildebeest"; # classical "herd" active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brethren"; # classical others active
is PL_N("person") => "person's"; # classical "persons" active
is PL_N("formula") => "formulae"; # classical "ancient" active
# CLASSICAL PLURALS REDEACTIVATED...
classical 0;
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("Sally") => "Sally's"; # classical "names" not active
is PL_N("brother") => "brother's"; # classical others not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
# CLASSICAL PLURALS REREACTIVATED...
classical 1;
is PL_N("error", 0) => "error"; # classical "zero" active
is PL_N("wildebeest") => "wildebeest"; # classical "herd" active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brethren"; # classical others active
is PL_N("person") => "person's"; # classical "persons" active
is PL_N("formula") => "formulae"; # classical "ancient" active
# CLASSICAL PLURALS REREDEACTIVATED...
classical 0;
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("Sally") => "Sally's"; # classical "names" not active
is PL_N("brother") => "brother's"; # classical others not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
# CLASSICAL PLURALS REREREACTIVATED...
classical;
is PL_N("error", 0) => "error"; # classical "zero" active
is PL_N("wildebeest") => "wildebeest"; # classical "herd" active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brethren"; # classical others active
is PL_N("person") => "person's"; # classical "persons" active
is PL_N("formula") => "formulae"; # classical "ancient" active
t/classical_ancient.t view on Meta::CPAN
is PL_N('formula') => "formula's"; # classical 'ancient' not active
# "person" PLURALS ACTIVATED...
classical 'ancient';
is PL_N('formula') => 'formulae'; # classical 'ancient' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N('wildebeest') => "wildebeest's"; # classical 'herd' not active
is PL_N('error', 0) => "error's"; # classical 'zero' not active
is PL_N('Sally') => "Sally's"; # classical 'names' active
is PL_N('brother') => "brother's"; # classical 'all' not active
is PL_N('person') => 'people'; # classical 'persons' not active
t/classical_ancient_1.t view on Meta::CPAN
is PL_N('formula') => "formula's"; # classical 'ancient' not active
# "person" PLURALS ACTIVATED...
classical ancient => 1;
is PL_N('formula') => 'formulae'; # classical 'ancient' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N('wildebeest') => "wildebeest's"; # classical 'herd' not active
is PL_N('error', 0) => "error's"; # classical 'zero' not active
is PL_N('Sally') => "Sally's"; # classical 'names' active
is PL_N('brother') => "brother's"; # classical 'all' not active
is PL_N('person') => 'people'; # classical 'persons' not active
t/classical_herd.t view on Meta::CPAN
# HERD PLURALS ACTIVATED...
classical 'herd';
is PL_N('wildebeest') => 'wildebeest'; # classical 'herd' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N('person') => 'people'; # classical 'persons' not active
is PL_N('formula') => "formula's"; # classical 'ancient' not active
is PL_N('error', 0) => "error's"; # classical 'zero' not active
is PL_N('Sally') => "Sally's"; # classical 'names' active
is PL_N('brother') => "brother's"; # classical 'all' not active
t/classical_herd_1.t view on Meta::CPAN
# HERD PLURALS ACTIVATED...
classical herd => 1;
is PL_N('wildebeest') => 'wildebeest'; # classical 'herd' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N('person') => 'people'; # classical 'persons' not active
is PL_N('formula') => "formula's"; # classical 'ancient' not active
is PL_N('error', 0) => "error's"; # classical 'zero' not active
is PL_N('Sally') => "Sally's"; # classical 'names' active
is PL_N('brother') => "brother's"; # classical 'all' not active
t/classical_names.t view on Meta::CPAN
# "person" PLURALS ACTIVATED...
classical "names";
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("Jones", 0) => "Jones's"; # always inflects that way
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("brother") => "brother's"; # classical "all" not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
# "person" PLURALS DEACTIVATED...
classical names=>0;
is PL_N("Sally") => "Sally's"; # classical "names" not active
is PL_N("Jones", 0) => "Jones's"; # always inflects that way
t/classical_names_1.t view on Meta::CPAN
# "person" PLURALS ACTIVATED...
classical names=>1;
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("Jones") => "Jones's"; # always inflects that way
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("brother") => "brother's"; # classical "all" not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
t/classical_person.t view on Meta::CPAN
# "person" PLURALS ACTIVATED...
classical "persons";
is PL_N("person") => "person's"; # classical "persons" active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brother's"; # classical "all" not active
t/classical_person_1.t view on Meta::CPAN
# "person" PLURALS ACTIVATED...
classical persons=>1;
is PL_N('person') => "person's"; # classical 'persons' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
is PL_N("error", 0) => "error's"; # classical "zero" not active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brother's"; # classical "all" not active
t/classical_zero.t view on Meta::CPAN
use Acme::Lingua::EN::Inflect::Modern qw(PL_N classical);
use Test::More 'no_plan';
# DEFAULT...
is PL_N('error', 0) => "error's"; # classical 'zero' not active
# "person" PLURALS ACTIVATED...
classical 'zero';
is PL_N('error', 0) => 'error'; # classical 'zero' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N("wildebeest") => "wildebeest's"; # classical "herd" not active
is PL_N("Sally") => "Sally's"; # classical "names" active
is PL_N("brother") => "brother's"; # classical "all" not active
is PL_N("person") => "people"; # classical "persons" not active
is PL_N("formula") => "formula's"; # classical "ancient" not active
t/classical_zero_1.t view on Meta::CPAN
use Acme::Lingua::EN::Inflect::Modern qw(PL_N classical);
use Test::More 'no_plan';
# DEFAULT...
is PL_N('error', 0) => "error's"; # classical 'zero' not active
# "person" PLURALS ACTIVATED...
classical zero => 1;
is PL_N('error', 0) => 'error'; # classical 'zero' active
# OTHER CLASSICALS NOT ACTIVATED...
is PL_N('wildebeest') => "wildebeest's"; # classical 'herd' not active
is PL_N('Sally') => "Sally's"; # classical 'names' active
is PL_N('brother') => "brother's"; # classical 'all' not active
is PL_N('person') => "people"; # classical 'persons' not active
is PL_N('formula') => "formula's"; # classical 'ancient' not active