summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-01-02 08:17:02 -0600
committerJesse Luehrs <doy@tozt.net>2011-01-02 08:17:02 -0600
commit897e73fcd9c1745d4823e6875039a4f29f2bb504 (patch)
tree82694e119c9c631b714f74a22d8780e3993203e7
parent6dfe93ae6d83e9897a4d223dda1d7607d86f9b8c (diff)
downloaddist-checkconflicts-897e73fcd9c1745d4823e6875039a4f29f2bb504.tar.gz
dist-checkconflicts-897e73fcd9c1745d4823e6875039a4f29f2bb504.zip
tests for the also stuff0.02
-rw-r--r--t/05-also.t32
-rw-r--r--t/lib/05/Bar/Conflicts.pm13
-rw-r--r--t/lib/05/Bar/Conflicts2.pm13
-rw-r--r--t/lib/05/Foo.pm5
-rw-r--r--t/lib/05/Foo/Conflicts.pm11
5 files changed, 74 insertions, 0 deletions
diff --git a/t/05-also.t b/t/05-also.t
new file mode 100644
index 0000000..286f8fa
--- /dev/null
+++ b/t/05-also.t
@@ -0,0 +1,32 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+use Test::Fatal;
+use lib 't/lib/05';
+
+{
+ use_ok('Bar::Conflicts');
+ is_deeply(
+ { Bar::Conflicts->conflicts },
+ {
+ 'Bar::Local' => '0.02',
+ 'Foo::Thing' => '0.01',
+ 'Foo::Thing::Sub' => '0.05',
+ },
+ "can detect the proper conflicts module"
+ );
+}
+
+{
+ use_ok('Bar::Conflicts2');
+ is_deeply(
+ { Bar::Conflicts2->conflicts },
+ {
+ 'Bar::Also' => '0.06',
+ },
+ "unknown also entries are ignored"
+ );
+}
+
+done_testing;
diff --git a/t/lib/05/Bar/Conflicts.pm b/t/lib/05/Bar/Conflicts.pm
new file mode 100644
index 0000000..ffeb56a
--- /dev/null
+++ b/t/lib/05/Bar/Conflicts.pm
@@ -0,0 +1,13 @@
+package Bar::Conflicts;
+use strict;
+use warnings;
+
+use Dist::CheckConflicts
+ -conflicts => {
+ 'Bar::Local' => 0.02,
+ },
+ -also => [
+ 'Foo',
+ ];
+
+1;
diff --git a/t/lib/05/Bar/Conflicts2.pm b/t/lib/05/Bar/Conflicts2.pm
new file mode 100644
index 0000000..d45754e
--- /dev/null
+++ b/t/lib/05/Bar/Conflicts2.pm
@@ -0,0 +1,13 @@
+package Bar::Conflicts2;
+use strict;
+use warnings;
+
+use Dist::CheckConflicts
+ -conflicts => {
+ 'Bar::Also' => 0.06,
+ },
+ -also => [
+ 'Baz',
+ ];
+
+1;
diff --git a/t/lib/05/Foo.pm b/t/lib/05/Foo.pm
new file mode 100644
index 0000000..8c4dc16
--- /dev/null
+++ b/t/lib/05/Foo.pm
@@ -0,0 +1,5 @@
+package Foo;
+
+sub foo { }
+
+1;
diff --git a/t/lib/05/Foo/Conflicts.pm b/t/lib/05/Foo/Conflicts.pm
new file mode 100644
index 0000000..0d9d7ef
--- /dev/null
+++ b/t/lib/05/Foo/Conflicts.pm
@@ -0,0 +1,11 @@
+package Foo::Conflicts;
+use strict;
+use warnings;
+
+use Dist::CheckConflicts
+ -conflicts => {
+ 'Foo::Thing' => 0.01,
+ 'Foo::Thing::Sub' => 0.05,
+ };
+
+1;