File: readme.t

package info (click to toggle)
libdist-zilla-perl 6.032-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,928 kB
  • sloc: perl: 7,275; makefile: 4; sh: 1
file content (58 lines) | stat: -rw-r--r-- 945 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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;