summaryrefslogtreecommitdiffstats
path: root/t/scripts/Lintian/Relation/03-duplicates.t
diff options
context:
space:
mode:
Diffstat (limited to 't/scripts/Lintian/Relation/03-duplicates.t')
-rwxr-xr-xt/scripts/Lintian/Relation/03-duplicates.t29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/scripts/Lintian/Relation/03-duplicates.t b/t/scripts/Lintian/Relation/03-duplicates.t
new file mode 100755
index 0000000..84d22c6
--- /dev/null
+++ b/t/scripts/Lintian/Relation/03-duplicates.t
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+
+use Lintian::Relation;
+
+my $relation_a
+ = Lintian::Relation->new->load_norestriction(
+ 'pkgA, pkgB, pkgC, pkgA | pkgD');
+
+my $relation_b
+ = Lintian::Relation->new->load_norestriction(
+ 'pkgA, pkgB, pkgC, pkgD | pkgE');
+
+is_deeply(
+ $relation_a->redundancies,
+ (['pkgA:any', 'pkgA:any | pkgD:any']),
+ 'Find redundancies'
+);
+is($relation_b->redundancies, 0, 'No redundancies');
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 sr et