diff options
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}}, |