File: parse_module_index.t

package info (click to toggle)
libcpan-reporter-smoker-perl 0.30-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: perl: 701; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (4)
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
use strict;
use warnings;

use Test::More;

use CPAN::Reporter::Smoker;

plan tests => 9;

my $list = CPAN::Reporter::Smoker::_parse_module_index('t/parse_module_index/02packages.details.txt', 't/parse_module_index/find-ls', 0);
is(scalar(@$list), 10);
ok((grep {$_ eq 'PETDANCE/Test-Harness-2.62_02.tar.gz'} @$list), 'Test-Harness-2.62_02 present');
ok(!(grep {$_ eq 'PETDANCE/Test-Harness-2.62_01.tar.gz'} @$list), 'Test-Harness-2.62_01 not present');

ok(!(grep {$_ eq 'DAGOLDEN/Bundle-Fake-1.00.tar.gz'} @$list), 'bundle module not present');

ok((grep {$_ eq 'TEST/Test-Test-1.01.tar.gz'} @$list), 'Test-Test-1.01 present');
ok(!(grep {$_ eq 'TEST/Test-Test-1.00_01.tar.gz'} @$list), 'Test-Test-1.00_01 not present');

my $list1 = CPAN::Reporter::Smoker::_parse_module_index('t/parse_module_index/02packages.details.txt', 't/parse_module_index/find-ls', 1);
is(scalar(@$list1), 7, 'correct amount without trial versions');

my $list2 = CPAN::Reporter::Smoker::_parse_module_index('t/parse_module_index/t_02packages.details.txt', 't/parse_module_index/t_find-ls', 0, '20080101');
is(scalar(@$list2), 4, 'correct amount with date');
@$list2 = sort @$list2;
is_deeply($list2, [
    'TEST/Test-Test-1.01_02.tar.gz',
    'TEST/Test-Test2-1.02.tar.gz',
    'TEST/Test-Test2-1.03_01.tar.gz',
    'TEST/Test-Test3-1.03_02.tar.gz'
], 'correct distributions');