aboutsummaryrefslogtreecommitdiffstats
path: root/t/parse.t
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2004-04-22 09:54:05 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2004-04-22 09:54:05 +0000
commit303c1a457e142968d06ac966705dfc58dca32e44 (patch)
tree27b00ad8992f62e4504adddbd0068bc40caf3de5 /t/parse.t
parent7a0c5bb46de811bad75bd517ccc963af63cfc08b (diff)
downloadperl-URPM-303c1a457e142968d06ac966705dfc58dca32e44.tar
perl-URPM-303c1a457e142968d06ac966705dfc58dca32e44.tar.gz
perl-URPM-303c1a457e142968d06ac966705dfc58dca32e44.tar.bz2
perl-URPM-303c1a457e142968d06ac966705dfc58dca32e44.tar.xz
perl-URPM-303c1a457e142968d06ac966705dfc58dca32e44.zip
- test rpm parsing and hdlist generation
Diffstat (limited to 't/parse.t')
-rw-r--r--t/parse.t24
1 files changed, 23 insertions, 1 deletions
diff --git a/t/parse.t b/t/parse.t
index 16dfc94..2d5e077 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -1,8 +1,10 @@
#!/usr/bin/perl
+# $Id$
+
use strict ;
use warnings ;
-use Test::More tests => 4;
+use Test::More tests => 13;
use URPM;
use URPM::Build;
use URPM::Query;
@@ -14,7 +16,27 @@ my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "test-rpm-1.0-1mdk.no
ok(@{$a->{depslist}} == 1);
my $pkg = $a->{depslist}[0];
ok($pkg);
+ok($a->list_rpm_tag);
ok($pkg->get_tag(1000) eq 'test-rpm');
+ok($pkg->get_tag(1001) eq '1.0');
+ok($pkg->get_tag(1002) eq '1mdk');
+
+$a->build_hdlist(start => 0,
+ end => $#{$a->{depslist}},
+ hdlist => 'hdlist.cz',
+ ratio => 9);
+
+ok(-f 'hdlist.cz');
+
+my $b = new URPM;
+my ($start, $end) = $b->parse_hdlist('hdlist.cz', keep_all_tags => 1);
+ok(@{$b->{depslist}} == 1);
+my $pkg = $b->{depslist}[0];
+ok($pkg);
+ok($pkg->get_tag(1000) eq 'test-rpm');
+ok($pkg->get_tag(1001) eq '1.0');
+ok($pkg->get_tag(1002) eq '1mdk');
+