aboutsummaryrefslogtreecommitdiffstats
path: root/t/rpmdb.t
diff options
context:
space:
mode:
Diffstat (limited to 't/rpmdb.t')
-rw-r--r--t/rpmdb.t28
1 files changed, 15 insertions, 13 deletions
diff --git a/t/rpmdb.t b/t/rpmdb.t
index c6a1040..898588d 100644
--- a/t/rpmdb.t
+++ b/t/rpmdb.t
@@ -14,19 +14,21 @@ use URPM;
print "1..5\n";
-my $db;
-ok(1, $db = URPM::DB::open);
-
-my @all_pkgs_extern = sort { $a cmp $b } split '\n', `rpm -qa`;
-ok(2, @all_pkgs_extern > 0);
-
-my @all_pkgs;
-my $count = $db->traverse(sub {
- my ($pkg) = @_;
- my ($name, $version, $release, $arch) = $pkg->fullname;
- $arch or return;
- push @all_pkgs, "$name-$version-$release";
- });
+my ($count, @all_pkgs_extern, @all_pkgs);
+{
+ my $db;
+ ok(1, $db = URPM::DB::open);
+
+ @all_pkgs_extern = sort { $a cmp $b } split '\n', `rpm -qa`;
+ ok(2, @all_pkgs_extern > 0);
+
+ $count = $db->traverse(sub {
+ my ($pkg) = @_;
+ my ($name, $version, $release, $arch) = $pkg->fullname;
+ $arch or return;
+ push @all_pkgs, "$name-$version-$release";
+ });
+}
ok(3, $count == @all_pkgs_extern);
ok(4, $count == @all_pkgs);