aboutsummaryrefslogtreecommitdiffstats
path: root/t/parse.t
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-26 18:18:30 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-26 18:18:30 +0000
commitf3a5346c94ceed8c28a10511db0b1019ec532971 (patch)
tree20a447700578ea9fcd83842600b55f1a0299329a /t/parse.t
parent0f5e4ddc50cf8f93de30d8c10477fff5d9d99282 (diff)
parent4e351504dc092a0a99f33dcbd301f48877eaa2f0 (diff)
downloadperl-URPM-f3a5346c94ceed8c28a10511db0b1019ec532971.tar
perl-URPM-f3a5346c94ceed8c28a10511db0b1019ec532971.tar.gz
perl-URPM-f3a5346c94ceed8c28a10511db0b1019ec532971.tar.bz2
perl-URPM-f3a5346c94ceed8c28a10511db0b1019ec532971.tar.xz
perl-URPM-f3a5346c94ceed8c28a10511db0b1019ec532971.zip
branch
Diffstat (limited to 't/parse.t')
-rw-r--r--t/parse.t15
1 files changed, 11 insertions, 4 deletions
diff --git a/t/parse.t b/t/parse.t
index 92159e8..ef8b5fd 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -4,18 +4,18 @@
use strict;
use warnings;
-use Test::More tests => 38;
+use Test::More tests => 39;
use MDV::Packdrakeng;
use URPM;
use URPM::Build;
-
+use URPM::Query;
chdir 't' if -d 't';
# shut up
URPM::setVerbosity(2);
-my $a = URPM->new;
+my $a = new URPM;
ok($a);
END { system('rm -rf hdlist.cz empty_hdlist.cz headers tmp') }
@@ -54,7 +54,7 @@ $a->build_hdlist(
ok(-f 'hdlist.cz');
-my $b = URPM->new;
+my $b = new URPM;
($start, $end) = $b->parse_hdlist('hdlist.cz', keep_all_tags => 1);
is("$start $end", "0 0", 'parse_hdlist');
ok(@{$b->{depslist}} == 1);
@@ -65,6 +65,9 @@ is($pkg->get_tag(1001), '1.0', 'version');
is($pkg->get_tag(1002), '1mdk', 'release');
is($pkg->queryformat("%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}"), "test-rpm-1.0-1mdk.noarch",
q(get headers from hdlist));
+rpm_is_jbj_version() ?
+ ok($pkg->is_platform_compat() > 0, "can evaluate platform score") :
+ pass('no platform compat');
my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "tmp/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
dir => 'headers') ] };
@@ -110,3 +113,7 @@ ok(URPM::rpmvercmp("1:1-1mdk", "2:1-1mdk") == -1, "epoch 1 vs 2 = -1");
END { unlink "bad.spec" }
}
+sub rpm_is_jbj_version {
+ # checking for --yaml support
+ `rpm --help` =~ /yaml/;
+}