File: manifest.t

package info (click to toggle)
libdist-zilla-perl 4.300020-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,144 kB
  • sloc: perl: 6,159; makefile: 9
file content (64 lines) | stat: -rw-r--r-- 1,393 bytes parent folder | download | duplicates (2)
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
59
60
61
62
63
64
use strict;
use warnings;
use Test::More 0.88;

use ExtUtils::Manifest;

use lib 't/lib';

use Test::DZil;

my $tzil = Builder->from_config(
  { dist_root => 'corpus/dist/DZT' },
  {
    add_files => {
      q{source/file with spaces.txt}        => "foo\n",
      # q{source/file\\with some\\whacks.txt} => "bar\n",
      # q{source/'file-with-ticks.txt'}       => "baz\n",
      # q{source/file'with'quotes\\or\\backslash.txt} => "quux\n",
      'source/dist.ini' => simple_ini(
        'GatherDir',
        'Manifest',
      ),
    },
  },
);

$tzil->build;

my $manihash = ExtUtils::Manifest::maniread($tzil->built_in->file('MANIFEST'));

is_deeply(
  [ sort keys %$manihash ],
  [ sort(
    'MANIFEST',
    q{file with spaces.txt},
    # q{file\\with some\\whacks.txt},
    # q{file'with'quotes\\or\\backslash.txt},
    # q{'file-with-ticks.txt'},
    'dist.ini',
    'lib/DZT/Sample.pm',
    't/basic.t',
  ) ],
  'manifest quotes files with spaces'
);

my @manilines = split /\n/, $tzil->slurp_file('build/MANIFEST');
chomp @manilines;

is_deeply(
  [ sort @manilines ],
  [ sort(
    'MANIFEST',
    q{'file with spaces.txt'},
    # q{'file\\\\with some\\\\whacks.txt'},
    # q{'\\'file-with-ticks.txt\\''},
    # q{'file\\'with\\'quotes\\\\or\\\\backslash.txt'},
    'dist.ini',
    'lib/DZT/Sample.pm',
    't/basic.t',
  ) ],
  'manifest quotes files with spaces'
);

done_testing;