aboutsummaryrefslogtreecommitdiffstats
path: root/t/synthesis.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-12-04 10:32:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-12-04 10:32:48 +0000
commit7629179cc5c88d8207a43282134d3d767121ce39 (patch)
treed70dfa22b734632ffcdb5fdc796b72264b1e9676 /t/synthesis.t
parent82e8182e3e9aa64ea7f3ef8cc2cd652927f8fb7c (diff)
downloadperl-URPM-7629179cc5c88d8207a43282134d3d767121ce39.tar
perl-URPM-7629179cc5c88d8207a43282134d3d767121ce39.tar.gz
perl-URPM-7629179cc5c88d8207a43282134d3d767121ce39.tar.bz2
perl-URPM-7629179cc5c88d8207a43282134d3d767121ce39.tar.xz
perl-URPM-7629179cc5c88d8207a43282134d3d767121ce39.zip
- much stricter synthesis parsing. fail on first error
- add test using a buggy synthesis that occured on kenobi
Diffstat (limited to 't/synthesis.t')
-rw-r--r--t/synthesis.t27
1 files changed, 17 insertions, 10 deletions
diff --git a/t/synthesis.t b/t/synthesis.t
index 4050493..f44e769 100644
--- a/t/synthesis.t
+++ b/t/synthesis.t
@@ -2,19 +2,19 @@
use strict ;
use warnings ;
-use Test::More tests => 86;
+use Test::More tests => 88;
use URPM;
my $file1 = 'synthesis.sample.cz';
open my $f, "| gzip -9 >$file1";
-print $f q{
-glibc-devel@provides@glibc-devel == 6:2.2.4-25mdk
-glibc-devel@requires@/sbin/install-info@glibc == 2.2.4@kernel-headers@kernel-headers >= 2.2.1@/bin/sh@/bin/sh@/bin/sh@rpmlib(PayloadFilesHavePrefix) <= 4.0-1@rpmlib(CompressedFileNames) <= 3.0.4-1
-glibc-devel@conflicts@texinfo < 3.11@gcc < 2.96-0.50mdk
-glibc-devel@obsoletes@libc-debug@libc-headers@libc-devel@linuxthreads-devel@glibc-debug
-glibc-devel@info@glibc-devel-2.2.4-25mdk.i586@6@45692097@Development/C
-};
+print $f <<'EOF';
+@provides@glibc-devel == 6:2.2.4-25mdk
+@requires@/sbin/install-info@glibc == 2.2.4@kernel-headers@kernel-headers >= 2.2.1@/bin/sh@/bin/sh@/bin/sh@rpmlib(PayloadFilesHavePrefix) <= 4.0-1@rpmlib(CompressedFileNames) <= 3.0.4-1
+@conflicts@texinfo < 3.11@gcc < 2.96-0.50mdk
+@obsoletes@libc-debug@libc-headers@libc-devel@linuxthreads-devel@glibc-debug
+@info@glibc-devel-2.2.4-25mdk.i586@6@45692097@Development/C
+EOF
close $f;
END { unlink $file1 }
@@ -22,9 +22,16 @@ END { unlink $file1 }
my $a = new URPM;
ok($a);
-my ($first, $end) = $a->parse_synthesis($file1);
+my ($first, $end);
+
+($first, $end) = URPM->new->parse_synthesis('t/empty_synthesis.cz');
+is("$first $end", "0 -1", 'parse empty synthesis');
+
+is(URPM->new->parse_synthesis('t/buggy_synthesis.cz'), undef, 'parse buggy synthesis');
+
+($first, $end) = $a->parse_synthesis($file1);
ok($first == 0 && $end == 0);
-ok(@{$a->{depslist}} == 1);
+is(int @{$a->{depslist}}, 1);
ok(keys(%{$a->{provides}}) == 3);
ok(defined $a->{provides}{'glibc-devel'});
ok(exists $a->{provides}{'/bin/sh'});