More tests.
authorrjray <devnull@localhost>
Fri, 10 Nov 2000 09:41:50 +0000 (09:41 +0000)
committerrjray <devnull@localhost>
Fri, 10 Nov 2000 09:41:50 +0000 (09:41 +0000)
CVS patchset: 4250
CVS date: 2000/11/10 09:41:50

Perl-RPM/t/01_database.t

index 80955d2..09da5b1 100755 (executable)
@@ -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);