aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-22 03:15:21 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-07-22 03:15:21 +0000
commitf60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49 (patch)
tree2bf1d959464d7c88967447067fbe6dc40099ddb4 /t
parent1a4d8108ef94266bb631b4c3aaa066f8a788b368 (diff)
downloadperl-URPM-f60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49.tar
perl-URPM-f60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49.tar.gz
perl-URPM-f60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49.tar.bz2
perl-URPM-f60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49.tar.xz
perl-URPM-f60ad53050bcbcfbfaa1fe4d43a77f43a6c04f49.zip
Add URPM::stream2header (borrowed from perl-Hdlist, thanks to Olivier
Thauvin)
Diffstat (limited to 't')
-rw-r--r--t/parse.t23
1 files changed, 18 insertions, 5 deletions
diff --git a/t/parse.t b/t/parse.t
index 92d14d0..6fb4b26 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -4,7 +4,7 @@
use strict ;
use warnings ;
-use Test::More tests => 15;
+use Test::More tests => 20;
use URPM;
use URPM::Build;
use URPM::Query;
@@ -25,10 +25,12 @@ ok($pkg->get_tag(1001) eq '1.0');
ok($pkg->get_tag(1002) eq '1mdk');
ok($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}") eq "test-rpm-1.0-1mdk.noarch");
-$a->build_hdlist(start => 0,
- end => $#{$a->{depslist}},
- hdlist => 'hdlist.cz',
- ratio => 9);
+$a->build_hdlist(
+ start => 0,
+ end => $#{$a->{depslist}},
+ hdlist => 'hdlist.cz',
+ ratio => 9,
+);
ok(-f 'hdlist.cz');
@@ -41,3 +43,14 @@ ok($pkg->get_tag(1000) eq 'test-rpm');
ok($pkg->get_tag(1001) eq '1.0');
ok($pkg->get_tag(1002) eq '1mdk');
ok($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}") eq "test-rpm-1.0-1mdk.noarch");
+
+{
+ open(my $hdfh, "zcat hdlist.cz |") or die $!;
+ my $pkg = URPM::stream2header($hdfh);
+ ok(defined $pkg, "Reading a header works");
+ ok($pkg->get_tag(1000) eq 'test-rpm');
+ ok($pkg->get_tag(1001) eq '1.0');
+ ok($pkg->get_tag(1002) eq '1mdk');
+ ok($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}") eq "test-rpm-1.0-1mdk.noarch");
+ close $hdfh;
+}