diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-17 16:43:38 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-17 16:43:38 +0000 |
commit | 9b255a188cc411228f646002d0e6e169485ddbc5 (patch) | |
tree | bfb1c50a551cb6e849b349bd38f655bedf67a1d4 /t/parse.t | |
parent | ea35868de9cad3cb07c5ff1f0a2f1776f54be5a1 (diff) | |
download | perl-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
Diffstat (limited to 't/parse.t')
-rw-r--r-- | t/parse.t | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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}}, |