summaryrefslogtreecommitdiffstats
path: root/t/02-conflicts.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02-conflicts.t')
-rw-r--r--t/02-conflicts.t28
1 files changed, 26 insertions, 2 deletions
diff --git a/t/02-conflicts.t b/t/02-conflicts.t
index 7303be2..e788815 100644
--- a/t/02-conflicts.t
+++ b/t/02-conflicts.t
@@ -20,7 +20,18 @@ use lib 't/lib/02';
}
{
- use_ok('Foo::Conflicts::Bad');
+ {
+ my $warnings;
+ local $SIG{__WARN__} = sub { $warnings .= $_[0] };
+ use_ok('Foo::Conflicts::Bad');
+ is($warnings, <<'EOF', "got correct runtime warnings");
+Conflict detected for Foo::Conflicts::Bad:
+ Foo::Two is version 0.02, but must be greater than version 0.02
+Conflict detected for Foo::Conflicts::Bad:
+ Foo is version 0.02, but must be greater than version 0.03
+EOF
+ }
+
is_deeply(
[ Foo::Conflicts::Bad->calculate_conflicts ],
[
@@ -51,7 +62,20 @@ use lib 't/lib/02';
}
{
- use_ok('Bar::Conflicts::Bad');
+ {
+ my $warnings;
+ local $SIG{__WARN__} = sub { $warnings .= $_[0] };
+ use_ok('Bar::Conflicts::Bad');
+ is($warnings, <<'EOF', "got correct runtime warnings");
+Conflict detected for Bar::Conflicts::Bad2:
+ Bar::Two is version 0.02, but must be greater than version 0.02
+Conflict detected for Bar::Conflicts::Bad:
+ Bar::Two is version 0.02, but must be greater than version 0.02
+Conflict detected for Bar::Conflicts::Bad:
+ Bar is version 0.02, but must be greater than version 0.03
+EOF
+ }
+
is_deeply(
[ Bar::Conflicts::Bad->calculate_conflicts ],
[