line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl -w |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# The script tests Arch::Log parsing. |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1806
|
use Data::Dumper; |
|
1
|
|
|
|
|
10538
|
|
|
1
|
|
|
|
|
61
|
|
6
|
1
|
|
|
1
|
|
712
|
use FindBin; |
|
1
|
|
|
|
|
992
|
|
|
1
|
|
|
|
|
57
|
|
7
|
1
|
|
|
1
|
|
713
|
use lib "$FindBin::Bin/../perllib"; |
|
1
|
|
|
|
|
566
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
|
|
4
|
my $message = <
|
10
|
|
|
|
|
|
|
Revision: arch-perl--devel--0--patch-3 |
11
|
|
|
|
|
|
|
Archive: migo\@homemail.com--Perl-GPL |
12
|
|
|
|
|
|
|
Creator: Mikhael Goikhman |
13
|
|
|
|
|
|
|
Date: Sun Jul 18 03:48:56 IDT 2004 |
14
|
|
|
|
|
|
|
Standard-date: 2004-07-18 00:48:56 GMT |
15
|
|
|
|
|
|
|
Modified-files: perllib/Arch/Library.pm |
16
|
|
|
|
|
|
|
perllib/Arch/Session.pm perllib/Arch/Storage.pm |
17
|
|
|
|
|
|
|
New-patches: migo\@homemail.com--Perl-GPL/arch-perl--devel--0--patch-3 |
18
|
|
|
|
|
|
|
Summary: new Arch::Storage method expanded_revisions |
19
|
|
|
|
|
|
|
Keywords: |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
ENDSTRING |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
13
|
my $expected_desc = { |
24
|
|
|
|
|
|
|
name => 'patch-3', |
25
|
|
|
|
|
|
|
version => 'migo@homemail.com--Perl-GPL/arch-perl--devel--0', |
26
|
|
|
|
|
|
|
summary => 'new Arch::Storage method expanded_revisions', |
27
|
|
|
|
|
|
|
creator => 'Mikhael Goikhman', |
28
|
|
|
|
|
|
|
email => 'migo@homemail.com', |
29
|
|
|
|
|
|
|
username => 'migo', |
30
|
|
|
|
|
|
|
date => '2004-07-18 00:48:56 GMT', |
31
|
|
|
|
|
|
|
kind => 'cset', |
32
|
|
|
|
|
|
|
}; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
2
|
my $expected_dump = <
|
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
archive => 'migo\@homemail.com--Perl-GPL', |
37
|
|
|
|
|
|
|
body => '', |
38
|
|
|
|
|
|
|
creator => 'Mikhael Goikhman ', |
39
|
|
|
|
|
|
|
date => 'Sun Jul 18 03:48:56 IDT 2004', |
40
|
|
|
|
|
|
|
keywords => '', |
41
|
|
|
|
|
|
|
modified_files => [ |
42
|
|
|
|
|
|
|
'perllib/Arch/Library.pm', |
43
|
|
|
|
|
|
|
'perllib/Arch/Session.pm', |
44
|
|
|
|
|
|
|
'perllib/Arch/Storage.pm' |
45
|
|
|
|
|
|
|
], |
46
|
|
|
|
|
|
|
new_patches => [ |
47
|
|
|
|
|
|
|
'migo\@homemail.com--Perl-GPL/arch-perl--devel--0--patch-3' |
48
|
|
|
|
|
|
|
], |
49
|
|
|
|
|
|
|
revision => 'arch-perl--devel--0--patch-3', |
50
|
|
|
|
|
|
|
standard_date => '2004-07-18 00:48:56 GMT', |
51
|
|
|
|
|
|
|
summary => 'new Arch::Storage method expanded_revisions' |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
ENDSTRING |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
1
|
|
1093
|
use Test::More tests => 15; |
|
1
|
|
|
|
|
19224
|
|
|
1
|
|
|
|
|
56
|
|
56
|
1
|
|
|
1
|
|
7
|
use_ok("Arch::Log"); |
|
1
|
|
|
|
|
814
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
|
|
814
|
my $log = Arch::Log->new($message); |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
3
|
my $headers = $log->get_headers; |
61
|
1
|
|
33
|
|
|
16
|
ok($headers && ref($headers) eq 'HASH' && keys %$headers == 10, "get_headers"); |
62
|
|
|
|
|
|
|
|
63
|
1
|
|
|
|
|
478
|
is($log->header('body'), '', "check body"); |
64
|
|
|
|
|
|
|
|
65
|
1
|
|
|
|
|
537
|
is($log->header('standard_date'), '2004-07-18 00:48:56 GMT', "standard_date"); |
66
|
|
|
|
|
|
|
|
67
|
1
|
|
|
|
|
465
|
my $headers2 = $log->get_headers; |
68
|
1
|
|
|
|
|
5
|
is($headers, $headers2, "check get_headers consistency"); |
69
|
1
|
|
|
|
|
460
|
is_deeply($headers, $headers2, "the same deeply"); |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
695
|
my $mod_files = $headers->{modified_files}; |
72
|
1
|
|
33
|
|
|
19
|
ok($mod_files && ref($mod_files) eq 'ARRAY' && @$mod_files == 3, "modified_files"); |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
442
|
my $revision_desc = $log->get_revision_desc; |
75
|
1
|
|
|
|
|
7
|
isa_ok($revision_desc, "HASH", "get_revision_desc type"); |
76
|
1
|
|
|
|
|
694
|
delete $revision_desc->{age}; |
77
|
1
|
|
|
|
|
4
|
is_deeply($revision_desc, $expected_desc, "get_revision_desc hash"); |
78
|
|
|
|
|
|
|
|
79
|
1
|
|
|
|
|
923
|
is_deeply($headers, eval $expected_dump, "compare expected headers"); |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
|
|
1100
|
my ($version, $patchlevel) = $log->split_version; |
82
|
1
|
|
|
|
|
7
|
is($version, $expected_desc->{version}, "split_version version"); |
83
|
1
|
|
|
|
|
503
|
is($patchlevel, $expected_desc->{name}, "split_version patchlevel"); |
84
|
1
|
|
|
|
|
489
|
is($log->get_version, $expected_desc->{version}, "get_version"); |
85
|
1
|
|
|
|
|
407
|
is($log->get_revision, "$version--$patchlevel", "get_revision"); |
86
|
|
|
|
|
|
|
|
87
|
1
|
50
|
|
|
|
21
|
SKIP: { |
88
|
1
|
|
|
|
|
490
|
skip("old Data::Dumper", 1) unless Data::Dumper->can('Sortkeys'); |
89
|
1
|
|
|
|
|
8
|
is($log->dump, $expected_dump, "compare expected headers dump"); |
90
|
|
|
|
|
|
|
} |