aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-01-15 07:54:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-01-15 07:54:49 +0000
commitc0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5 (patch)
tree0ef4459a20de72f85cd799ecee1805046ee35823 /t
parentbe88fcbfd677d82f69ce79c7044ee854b0e4c8db (diff)
downloadperl-URPM-c0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5.tar
perl-URPM-c0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5.tar.gz
perl-URPM-c0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5.tar.bz2
perl-URPM-c0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5.tar.xz
perl-URPM-c0fdc9c9efcaafd0e2aa49bf23d1611d4a890cd5.zip
- chdir "t"
- remove temporary "headers/"
Diffstat (limited to 't')
-rw-r--r--t/parse.t30
1 files changed, 16 insertions, 14 deletions
diff --git a/t/parse.t b/t/parse.t
index a0c51f0..dd63d25 100644
--- a/t/parse.t
+++ b/t/parse.t
@@ -10,15 +10,17 @@ use URPM;
use URPM::Build;
use URPM::Query;
+chdir 't' if -d 't';
+
# shut up
URPM::setVerbosity(2);
my $a = new URPM;
ok($a);
-END { unlink 'hdlist.cz', 't/empty_hdlist.cz' }
+END { system('rm -rf hdlist.cz empty_hdlist.cz headers') }
-my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "t/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
+my ($start, $end) = $a->parse_rpms_build_headers(rpms => [ "RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ], keep_all_tags => 1);
ok(@{$a->{depslist}} == 1);
my $pkg = $a->{depslist}[0];
ok($pkg);
@@ -33,20 +35,20 @@ TODO: {
q/get headers from parsing rpm/);
}
-mkdir 't/headers';
-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');
+mkdir 'headers';
+system('touch headers/empty');
+is(URPM->new->parse_hdlist('headers/empty'), undef, 'empty header');
+system('echo FOO > headers/bad');
+is(URPM->new->parse_hdlist('headers/bad'), undef, 'bad rpm header');
$a->build_hdlist(
start => 0,
end => -1,
- hdlist => 't/empty_hdlist.cz',
+ hdlist => 'empty_hdlist.cz',
);
-ok(-f 't/empty_hdlist.cz');
+ok(-f 'empty_hdlist.cz');
-($start, $end) = URPM->new->parse_hdlist('t/empty_hdlist.cz');
+($start, $end) = URPM->new->parse_hdlist('empty_hdlist.cz');
is("$start $end", "0 -1", 'empty hdlist');
@@ -71,12 +73,12 @@ 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/);
-my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "t/RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
- dir => 't/headers') ] };
+my $headers = eval { [ $b->parse_rpms_build_headers(rpms => [ "RPMS/noarch/test-rpm-1.0-1mdk.noarch.rpm" ],
+ dir => 'headers') ] };
is($@, '', 'parse_rpms_build_headers');
is(int @$headers, 1, 'parse_rpms_build_headers');
ok(@{$b->{depslist}} == 2);
-($start, $end) = eval { $b->parse_headers(dir => "t/headers", headers => $headers) };
+($start, $end) = eval { $b->parse_headers(dir => "headers", headers => $headers) };
is($@, '', 'parse_headers');
is("$start $end", "2 2", 'parse_headers');
@@ -101,7 +103,7 @@ ok(URPM::rpmvercmp("1:1-1mdk", "2:1-1mdk") == -1, "epoch 1 vs 2 = -1");
}
{
- my $pkg = URPM::spec2srcheader("t/test-rpm.spec");
+ my $pkg = URPM::spec2srcheader("test-rpm.spec");
ok(defined $pkg, "Parsing a spec works");
is($pkg->get_tag(1000), 'test-rpm', 'parsed correctly');
$pkg = URPM::spec2srcheader("doesnotexist.spec");