aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-08-23 12:57:23 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-08-23 12:57:23 +0000
commit8cd4fc646f53866fe70208fe3303fea0ee40379f (patch)
treefea3d5988bbb1816804201f7096a4cdd1ac051f4 /t
parent9a1f0e891ef192fc72ae47a57453ce724353a063 (diff)
downloadrpmtools-8cd4fc646f53866fe70208fe3303fea0ee40379f.tar
rpmtools-8cd4fc646f53866fe70208fe3303fea0ee40379f.tar.gz
rpmtools-8cd4fc646f53866fe70208fe3303fea0ee40379f.tar.bz2
rpmtools-8cd4fc646f53866fe70208fe3303fea0ee40379f.tar.xz
rpmtools-8cd4fc646f53866fe70208fe3303fea0ee40379f.zip
Test fix to go along with the previous change. Be more TAP compliant.
Die early of errors.
Diffstat (limited to 't')
-rwxr-xr-xt/01packdrakeng.t14
1 files changed, 7 insertions, 7 deletions
diff --git a/t/01packdrakeng.t b/t/01packdrakeng.t
index 446ff8d..e5dbe5f 100755
--- a/t/01packdrakeng.t
+++ b/t/01packdrakeng.t
@@ -45,9 +45,9 @@ sub check_files {
my %files = @_;
my $ok = 1;
foreach my $f (keys %files) {
- open(my $h, $f);
+ open(my $h, $f) or die "Can't read $f: $!";
Digest::MD5->new->addfile($h)->hexdigest ne $files{$f} and do {
- print STDERR "$f differ\n";
+ diag "$f differ";
$ok = 0;
};
close $h;
@@ -73,7 +73,7 @@ sub test_packing {
ok($pack = Packdrakeng->open(%$pack_param), "Re-opening the archive");
$pack or die;
- ok($pack->extract(undef, keys(%$listfiles)), "extracting files");
+ ok($pack->extract('.', keys(%$listfiles)), "extracting files");
ok(check_files(%$listfiles), "Checking md5sum for extracted files");
$pack = undef;
@@ -134,22 +134,22 @@ ok($data eq $coin, "Data is correct");
}
-print "Test: using external cat function:\n";
+diag "Test: using external cat function:";
clean_test_files();
test_packing({ archive => "packtest-cat.cz", compress => 'cat', uncompress => 'cat', noargs => 1 }, { create_test_files(30) });
clean_test_files();
-print "Test: using internal gzip function:\n";
+diag "Test: using internal gzip function:";
clean_test_files();
test_packing({ archive => "packtest-gzipi.cz" }, { create_test_files(30) });
clean_test_files();
-print "Test: using external gzip function:\n";
+diag "Test: using external gzip function:";
clean_test_files();
test_packing({ archive => "packtest-gzip.cz", compress => "gzip", extern => 1}, { create_test_files(30) });
clean_test_files();
-print "Test: using external bzip function:\n";
+diag "Test: using external bzip function:";
clean_test_files();
test_packing({ archive => "packtest-bzip2.cz", compress => "bzip2", extern => 1}, { create_test_files(30) });
clean_test_files();