Acme-Unicodify
view release on metacpan or search on metacpan
t/00-report-prereqs.t view on Meta::CPAN
# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027
use Test::More tests => 1;
use ExtUtils::MakeMaker;
use File::Spec;
# from $version::LAX
my $lax_version_re =
qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
|
(?:\.[0-9]+) (?:_[0-9]+)?
) | (?:
v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
|
(?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
)
)/x;
# hide optional CPAN::Meta modules from prereq scanner
t/00-report-prereqs.t view on Meta::CPAN
for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
next if $mod eq 'perl';
next if grep { $_ eq $mod } @exclude;
my $file = $mod;
$file =~ s{::}{/}g;
$file .= ".pm";
my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
my $want = $req_hash->{$phase}{$type}{$mod};
$want = "undef" unless defined $want;
$want = "any" if !$want && $want == 0;
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'";
}
}
t/01-ToFromUnicode.t view on Meta::CPAN
'String changes when ASCII letters passed to to_unicode'
);
is(
$unify->back_to_ascii($unify->to_unicode( 'AaaaBbbbCcccDdddEeee\n A' )),
'AaaaBbbbCcccDdddEeee\n A',
'Conversion to/from Unicode is lossless'
);
is(
$unify->to_unicode(undef),
undef,
'to_unicode() handles undef'
);
is(
$unify->back_to_ascii(undef),
undef,
'back_to_ascii() handles undef'
);
my $text = <<'END_FILE';
This is a test. I want to throw in a bogus Unicode character just to validate that it is preserved.
This is line 2
This is a camel: \x{1F42A}
It should stay a camel.
END_FILE
$text = "
( run in 1.331 second using v1.01-cache-2.11-cpan-d80b1682f3f )