Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
autolicense.t
autoname.t
autoprereqs.t
autoversion.t
confirmrelease.t
distmeta-merge.t
distmeta.t
encoding.t
extratests.t
fakerelease.t
ffbyname.t
filefinders.t
filter-b.t
gatherdir.t
gatherfile.t
generatefile.t
installdirs.t
license.t
makemaker.t
manifest.t
metanoindex.t
metaresources.t
misctests.t
modulebuild.t
munger-that-prunes.t
nextrelease.t
pkgdist.t
pkgversion.t
podsyntaxtests.t
podversion.t
prereqs.t
prunes.t
readme.t
release_status.t
testrelease.t
uploadtocpan.t

readme.t

use strict;
use warnings;
use Test::More 0.88;
use utf8;

use autodie;
use Test::DZil;

my $tzil = Builder->from_config(
  { dist_root => 'corpus/dist/DZT' },
  {
    add_files => {
      'source/dist.ini' => simple_ini('Readme'),
    },
  },
);

$tzil->build;

my $contents = $tzil->slurp_file('build/README');

like(
  $contents,
  qr{This software is copyright .c. [0-9]+ by E\. Xavier Ample}i,
  "copyright appears in README file",
);

like(
  $contents,
  qr{same terms as (the )?perl.*itself}i,
  "'same terms as perl'-ish text appears in README",
);

my $name = $tzil->name;
like(
  $contents,
  qr{\Q$name\E},
  "dist name appears in README",
);

{
  my $tzil = Builder->from_config(
    { dist_root => 'corpus/dist/DZ-NonAscii' },
  );

  $tzil->build;

  my $contents = $tzil->slurp_file('build/README');

  like(
    $contents,
    qr{ภูมิพลอดุลยเดช},
    "HRH unmangled in README",
  );
}

done_testing;