File: tree-1

package info (click to toggle)
libarch-perl 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 576 kB
  • ctags: 430
  • sloc: perl: 6,145; makefile: 31
file content (48 lines) | stat: -rwxr-xr-x 1,371 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
#!/usr/bin/perl -w

# The script tests Arch::Tree methods.

use FindBin;
use lib "$FindBin::Bin/../perllib";

use Test::More;
use Arch::Util qw(is_tla_functional);

plan skip_all => "No functional arch backend" unless is_tla_functional;
plan tests => 11;

use_ok("Arch::Tree");

my $arch_dir = "$FindBin::Bin/../{arch}";

my $upstream = 'migo@homemail.com--Perl-GPL/arch-perl--devel--0';

SKIP: {
skip("not in arch tree", 10) unless -d "$arch_dir";

my $tree_version = `cat $arch_dir/++default-version`;
chomp($tree_version);

my $tree = Arch::Tree->new("$FindBin::Bin/..");

my $version1 = $tree->get_version;
ok(defined $version1,        "tree version exists");
is($version1, $tree_version, "tree version is correct");

my @versions = $tree->get_log_versions;
ok(@versions, "log versions");
ok((grep { $_ eq $upstream } @versions),     "log versions has upstream");
ok((grep { $_ eq $tree_version } @versions), "log versions has tree version");

my @revisions = $tree->get_log_revisions($upstream);
ok(@revisions, "upstream version log revisions");

my @logs = $tree->get_logs($upstream);
ok(@logs, "upstream version logs");

my $log = $logs[0];
is($log->revision, 'arch-perl--devel--0--base-0',  "import log revision");
is($log->summary, "initial import",                "import log summary");
is($log->standard_date, "2004-07-11 00:05:40 GMT", "import log date");

}