aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-17 16:43:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-17 16:43:38 +0000
commit9b255a188cc411228f646002d0e6e169485ddbc5 (patch)
treebfb1c50a551cb6e849b349bd38f655bedf67a1d4
parentea35868de9cad3cb07c5ff1f0a2f1776f54be5a1 (diff)
downloadperl-URPM-9b255a188cc411228f646002d0e6e169485ddbc5.tar
perl-URPM-9b255a188cc411228f646002d0e6e169485ddbc5.tar.gz
perl-URPM-9b255a188cc411228f646002d0e6e169485ddbc5.tar.bz2
perl-URPM-9b255a188cc411228f646002d0e6e169485ddbc5.tar.xz
perl-URPM-9b255a188cc411228f646002d0e6e169485ddbc5.zip
add some tests on empty header, buggy header, empty hdlist
-rw-r--r--t/parse.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/parse.t b/t/parse.t
index d62b34f..c44d756 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 35;
+use Test::More tests => 39;
use MDV::Packdrakeng;
use URPM;
use URPM::Build;
@@ -33,6 +33,22 @@ TODO: {
q/get headers from parsing rpm/);
}
+system('touch t/headers/empty');
+is(URPM->new->parse_hdlist('t/headers/empty'), undef, 'empty header');
+system('echo FOO > t/headers/bad');
+is(URPM->new->parse_hdlist('t/headers/bad'), undef, 'bad rpm header');
+
+$a->build_hdlist(
+ start => 0,
+ end => -1,
+ hdlist => 't/empty_hdlist.cz',
+);
+ok(-f 't/empty_hdlist.cz');
+
+($start, $end) = URPM->new->parse_hdlist('t/empty_hdlist.cz');
+is("$start $end", "0 -1", 'empty hdlist');
+
+
$a->build_hdlist(
start => 0,
end => $#{$a->{depslist}},