/
52methods-pages.t
37 lines (28 loc) · 1.12 KB
/
52methods-pages.t
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
#!perl
use strict;
use warnings;
use Test::More tests => 35;
use CPAN::Testers::WWW::Statistics::Pages;
use lib 't';
use CTWS_Testing;
ok( my $obj = CTWS_Testing::getObj(), "got parent object" );
ok( my $pages = CTWS_Testing::getPages(), "got pages object" );
$obj->address('t/data/addresses.txt');
my %names = (
'barbie@missbarbell.co.uk' => 'Barbie (BARBIE)',
'barbie@cpan.org' => 'barbie[]cpan org'
);
for my $name (keys %names) {
is($pages->_tester_name($name), $names{$name}, "tester name matches: $name");
}
my %exts = ( 1 => 'st', 2 => 'nd', 3 => 'rd', 4 => 'th', 5 => 'th',
6 => 'th', 7 => 'th', 8 => 'th', 9 => 'th', 10 => 'th',
11 => 'th', 12 => 'th', 13 => 'th', 14 => 'th', 15 => 'th',
16 => 'th', 17 => 'th', 18 => 'th', 19 => 'th', 20 => 'th',
21 => 'st', 22 => 'nd', 23 => 'rd', 24 => 'th', 25 => 'th',
26 => 'th', 27 => 'th', 28 => 'th', 29 => 'th', 30 => 'th',
31 => 'st'
);
for my $ext (keys %exts) {
is(CPAN::Testers::WWW::Statistics::Pages::_ext($ext),$exts{$ext}, "extension matches: $ext");
}