summaryrefslogtreecommitdiff
path: root/Perl-RPM
diff options
context:
space:
mode:
authorrjray <devnull@localhost>2000-11-10 09:41:50 +0000
committerrjray <devnull@localhost>2000-11-10 09:41:50 +0000
commit187174dc4b51b1b78d02e1c3f37f653de478cd66 (patch)
tree65c8b3a583c45207abadaaf22e773b0c92e585ba /Perl-RPM
parent011f727bbff26c84a2044c6458e3d06f972c486b (diff)
downloadrpm-187174dc4b51b1b78d02e1c3f37f653de478cd66.tar.gz
rpm-187174dc4b51b1b78d02e1c3f37f653de478cd66.tar.bz2
rpm-187174dc4b51b1b78d02e1c3f37f653de478cd66.zip
More tests.
CVS patchset: 4250 CVS date: 2000/11/10 09:41:50
Diffstat (limited to 'Perl-RPM')
-rwxr-xr-xPerl-RPM/t/01_database.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/Perl-RPM/t/01_database.t b/Perl-RPM/t/01_database.t
index 80955d290..09da5b17b 100755
--- a/Perl-RPM/t/01_database.t
+++ b/Perl-RPM/t/01_database.t
@@ -5,7 +5,7 @@ use RPM::Database;
$SIG{__WARN__} = sub { $@ = shift; };
$SIG{__DIE__} = sub { $@ = shift; };
-print "1..13\n";
+print "1..16\n";
$count = 1;
#
@@ -39,6 +39,16 @@ $rpm = $DB{$test_pack};
print "not " unless (defined $rpm and ref $rpm);
print "ok $count\n"; $count++;
+# Obviously, EXISTS should clear just fine
+print "not " unless (exists $DB{$test_pack});
+print "ok $count\n"; $count++;
+
+# Run over FIRSTKEY and NEXTKEY by iterating against a copy of %all_packs
+%tmp_packs = %all_packs;
+for (keys %DB) { delete $tmp_packs{$_} }
+print "not " if (keys %tmp_packs);
+print "ok $count\n"; $count++;
+
# Verify that STORE, DELETE and CLEAR operations are blocked
# STORE
eval {
@@ -76,6 +86,12 @@ print "ok $count\n"; $count++;
print "not " unless (exists $rpm->{$test_pack} and ref($rpm->{$test_pack}));
print "ok $count\n"; $count++;
+# Run over FIRSTKEY and NEXTKEY for the direct ref interface
+%tmp_packs = %all_packs;
+for (keys %$rpm) { delete $tmp_packs{$_} }
+print "not " if (keys %tmp_packs);
+print "ok $count\n"; $count++;
+
@matches = $rpm->find_by_file('/bin/rpm');
# There should be exactly one match:
print "not " unless (@matches == 1);