From 04a6fd13f7ea3a45881d6e75ea1dffba38a999fd Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 8 Jul 2013 17:20:23 -0400 Subject: remove test numbers --- t/01-basic.t | 47 --------------- t/02-conflicts.t | 104 -------------------------------- t/03-dist.t | 76 ----------------------- t/04-merge.t | 21 ------- t/05-also.t | 32 ---------- t/06-runtime.t | 47 --------------- t/also.t | 32 ++++++++++ t/basic.t | 47 +++++++++++++++ t/conflicts.t | 104 ++++++++++++++++++++++++++++++++ t/dist.t | 76 +++++++++++++++++++++++ t/lib/01/Bar/Conflicts.pm | 13 ---- t/lib/01/Bar/Conflicts2.pm | 13 ---- t/lib/01/Bar/Conflicts3.pm | 10 --- t/lib/01/Foo/Conflicts.pm | 11 ---- t/lib/02/Bar.pm | 7 --- t/lib/02/Bar/Conflicts/Bad.pm | 13 ---- t/lib/02/Bar/Conflicts/Bad2.pm | 13 ---- t/lib/02/Bar/Conflicts/Bad3.pm | 10 --- t/lib/02/Bar/Conflicts/Good.pm | 13 ---- t/lib/02/Bar/Conflicts/Good2.pm | 13 ---- t/lib/02/Bar/Conflicts/Good3.pm | 10 --- t/lib/02/Bar/Three.pm | 7 --- t/lib/02/Bar/Two.pm | 7 --- t/lib/02/Broken.pm | 3 - t/lib/02/Foo.pm | 7 --- t/lib/02/Foo/Conflicts/Bad.pm | 12 ---- t/lib/02/Foo/Conflicts/Broken.pm | 11 ---- t/lib/02/Foo/Conflicts/Good.pm | 13 ---- t/lib/02/Foo/Three.pm | 7 --- t/lib/02/Foo/Two.pm | 7 --- t/lib/03/Bar.pm | 7 --- t/lib/03/Bar/Conflicts/Bad.pm | 14 ----- t/lib/03/Bar/Conflicts/Bad2.pm | 14 ----- t/lib/03/Bar/Conflicts/Bad3.pm | 11 ---- t/lib/03/Bar/Conflicts/Good.pm | 14 ----- t/lib/03/Bar/Conflicts/Good2.pm | 14 ----- t/lib/03/Bar/Conflicts/Good3.pm | 11 ---- t/lib/03/Bar/Three.pm | 7 --- t/lib/03/Bar/Two.pm | 7 --- t/lib/03/Foo.pm | 7 --- t/lib/03/Foo/Conflicts/Bad.pm | 13 ---- t/lib/03/Foo/Conflicts/Good.pm | 13 ---- t/lib/03/Foo/Three.pm | 7 --- t/lib/03/Foo/Two.pm | 7 --- t/lib/04/Foo/Conflicts.pm | 15 ----- t/lib/04/Foo/Conflicts2.pm | 12 ---- t/lib/05/Bar/Conflicts.pm | 13 ---- t/lib/05/Bar/Conflicts2.pm | 13 ---- t/lib/05/Foo.pm | 5 -- t/lib/05/Foo/Conflicts.pm | 11 ---- t/lib/06/Bar.pm | 13 ---- t/lib/06/Bar/Bar.pm | 18 ------ t/lib/06/Bar/Bar/Bad.pm | 7 --- t/lib/06/Bar/Bar/Good.pm | 7 --- t/lib/06/Bar/Baz.pm | 18 ------ t/lib/06/Bar/Baz/Bad.pm | 7 --- t/lib/06/Bar/Baz/Good.pm | 7 --- t/lib/06/Bar/Conflicts.pm | 22 ------- t/lib/06/Bar/Foo.pm | 18 ------ t/lib/06/Bar/Foo/Bad.pm | 7 --- t/lib/06/Bar/Foo/Good.pm | 7 --- t/lib/06/Bar/Quux.pm | 18 ------ t/lib/06/Bar/Quux/Bad.pm | 7 --- t/lib/06/Bar/Quux/Good.pm | 7 --- t/lib/06/Foo.pm | 13 ---- t/lib/06/Foo/Bar.pm | 7 --- t/lib/06/Foo/Baz.pm | 7 --- t/lib/06/Foo/Conflicts.pm | 14 ----- t/lib/06/Foo/Foo.pm | 7 --- t/lib/06/Foo/Quux.pm | 7 --- t/lib/also/Bar/Conflicts.pm | 13 ++++ t/lib/also/Bar/Conflicts2.pm | 13 ++++ t/lib/also/Foo.pm | 5 ++ t/lib/also/Foo/Conflicts.pm | 11 ++++ t/lib/basic/Bar/Conflicts.pm | 13 ++++ t/lib/basic/Bar/Conflicts2.pm | 13 ++++ t/lib/basic/Bar/Conflicts3.pm | 10 +++ t/lib/basic/Foo/Conflicts.pm | 11 ++++ t/lib/conflicts/Bar.pm | 7 +++ t/lib/conflicts/Bar/Conflicts/Bad.pm | 13 ++++ t/lib/conflicts/Bar/Conflicts/Bad2.pm | 13 ++++ t/lib/conflicts/Bar/Conflicts/Bad3.pm | 10 +++ t/lib/conflicts/Bar/Conflicts/Good.pm | 13 ++++ t/lib/conflicts/Bar/Conflicts/Good2.pm | 13 ++++ t/lib/conflicts/Bar/Conflicts/Good3.pm | 10 +++ t/lib/conflicts/Bar/Three.pm | 7 +++ t/lib/conflicts/Bar/Two.pm | 7 +++ t/lib/conflicts/Broken.pm | 3 + t/lib/conflicts/Foo.pm | 7 +++ t/lib/conflicts/Foo/Conflicts/Bad.pm | 12 ++++ t/lib/conflicts/Foo/Conflicts/Broken.pm | 11 ++++ t/lib/conflicts/Foo/Conflicts/Good.pm | 13 ++++ t/lib/conflicts/Foo/Three.pm | 7 +++ t/lib/conflicts/Foo/Two.pm | 7 +++ t/lib/dist/Bar.pm | 7 +++ t/lib/dist/Bar/Conflicts/Bad.pm | 14 +++++ t/lib/dist/Bar/Conflicts/Bad2.pm | 14 +++++ t/lib/dist/Bar/Conflicts/Bad3.pm | 11 ++++ t/lib/dist/Bar/Conflicts/Good.pm | 14 +++++ t/lib/dist/Bar/Conflicts/Good2.pm | 14 +++++ t/lib/dist/Bar/Conflicts/Good3.pm | 11 ++++ t/lib/dist/Bar/Three.pm | 7 +++ t/lib/dist/Bar/Two.pm | 7 +++ t/lib/dist/Foo.pm | 7 +++ t/lib/dist/Foo/Conflicts/Bad.pm | 13 ++++ t/lib/dist/Foo/Conflicts/Good.pm | 13 ++++ t/lib/dist/Foo/Three.pm | 7 +++ t/lib/dist/Foo/Two.pm | 7 +++ t/lib/merge/Foo/Conflicts.pm | 15 +++++ t/lib/merge/Foo/Conflicts2.pm | 12 ++++ t/lib/runtime/Bar.pm | 13 ++++ t/lib/runtime/Bar/Bar.pm | 18 ++++++ t/lib/runtime/Bar/Bar/Bad.pm | 7 +++ t/lib/runtime/Bar/Bar/Good.pm | 7 +++ t/lib/runtime/Bar/Baz.pm | 18 ++++++ t/lib/runtime/Bar/Baz/Bad.pm | 7 +++ t/lib/runtime/Bar/Baz/Good.pm | 7 +++ t/lib/runtime/Bar/Conflicts.pm | 22 +++++++ t/lib/runtime/Bar/Foo.pm | 18 ++++++ t/lib/runtime/Bar/Foo/Bad.pm | 7 +++ t/lib/runtime/Bar/Foo/Good.pm | 7 +++ t/lib/runtime/Bar/Quux.pm | 18 ++++++ t/lib/runtime/Bar/Quux/Bad.pm | 7 +++ t/lib/runtime/Bar/Quux/Good.pm | 7 +++ t/lib/runtime/Foo.pm | 13 ++++ t/lib/runtime/Foo/Bar.pm | 7 +++ t/lib/runtime/Foo/Baz.pm | 7 +++ t/lib/runtime/Foo/Conflicts.pm | 14 +++++ t/lib/runtime/Foo/Foo.pm | 7 +++ t/lib/runtime/Foo/Quux.pm | 7 +++ t/merge.t | 21 +++++++ t/runtime.t | 47 +++++++++++++++ 132 files changed, 960 insertions(+), 960 deletions(-) delete mode 100644 t/01-basic.t delete mode 100644 t/02-conflicts.t delete mode 100644 t/03-dist.t delete mode 100644 t/04-merge.t delete mode 100644 t/05-also.t delete mode 100644 t/06-runtime.t create mode 100644 t/also.t create mode 100644 t/basic.t create mode 100644 t/conflicts.t create mode 100644 t/dist.t delete mode 100644 t/lib/01/Bar/Conflicts.pm delete mode 100644 t/lib/01/Bar/Conflicts2.pm delete mode 100644 t/lib/01/Bar/Conflicts3.pm delete mode 100644 t/lib/01/Foo/Conflicts.pm delete mode 100644 t/lib/02/Bar.pm delete mode 100644 t/lib/02/Bar/Conflicts/Bad.pm delete mode 100644 t/lib/02/Bar/Conflicts/Bad2.pm delete mode 100644 t/lib/02/Bar/Conflicts/Bad3.pm delete mode 100644 t/lib/02/Bar/Conflicts/Good.pm delete mode 100644 t/lib/02/Bar/Conflicts/Good2.pm delete mode 100644 t/lib/02/Bar/Conflicts/Good3.pm delete mode 100644 t/lib/02/Bar/Three.pm delete mode 100644 t/lib/02/Bar/Two.pm delete mode 100644 t/lib/02/Broken.pm delete mode 100644 t/lib/02/Foo.pm delete mode 100644 t/lib/02/Foo/Conflicts/Bad.pm delete mode 100644 t/lib/02/Foo/Conflicts/Broken.pm delete mode 100644 t/lib/02/Foo/Conflicts/Good.pm delete mode 100644 t/lib/02/Foo/Three.pm delete mode 100644 t/lib/02/Foo/Two.pm delete mode 100644 t/lib/03/Bar.pm delete mode 100644 t/lib/03/Bar/Conflicts/Bad.pm delete mode 100644 t/lib/03/Bar/Conflicts/Bad2.pm delete mode 100644 t/lib/03/Bar/Conflicts/Bad3.pm delete mode 100644 t/lib/03/Bar/Conflicts/Good.pm delete mode 100644 t/lib/03/Bar/Conflicts/Good2.pm delete mode 100644 t/lib/03/Bar/Conflicts/Good3.pm delete mode 100644 t/lib/03/Bar/Three.pm delete mode 100644 t/lib/03/Bar/Two.pm delete mode 100644 t/lib/03/Foo.pm delete mode 100644 t/lib/03/Foo/Conflicts/Bad.pm delete mode 100644 t/lib/03/Foo/Conflicts/Good.pm delete mode 100644 t/lib/03/Foo/Three.pm delete mode 100644 t/lib/03/Foo/Two.pm delete mode 100644 t/lib/04/Foo/Conflicts.pm delete mode 100644 t/lib/04/Foo/Conflicts2.pm delete mode 100644 t/lib/05/Bar/Conflicts.pm delete mode 100644 t/lib/05/Bar/Conflicts2.pm delete mode 100644 t/lib/05/Foo.pm delete mode 100644 t/lib/05/Foo/Conflicts.pm delete mode 100644 t/lib/06/Bar.pm delete mode 100644 t/lib/06/Bar/Bar.pm delete mode 100644 t/lib/06/Bar/Bar/Bad.pm delete mode 100644 t/lib/06/Bar/Bar/Good.pm delete mode 100644 t/lib/06/Bar/Baz.pm delete mode 100644 t/lib/06/Bar/Baz/Bad.pm delete mode 100644 t/lib/06/Bar/Baz/Good.pm delete mode 100644 t/lib/06/Bar/Conflicts.pm delete mode 100644 t/lib/06/Bar/Foo.pm delete mode 100644 t/lib/06/Bar/Foo/Bad.pm delete mode 100644 t/lib/06/Bar/Foo/Good.pm delete mode 100644 t/lib/06/Bar/Quux.pm delete mode 100644 t/lib/06/Bar/Quux/Bad.pm delete mode 100644 t/lib/06/Bar/Quux/Good.pm delete mode 100644 t/lib/06/Foo.pm delete mode 100644 t/lib/06/Foo/Bar.pm delete mode 100644 t/lib/06/Foo/Baz.pm delete mode 100644 t/lib/06/Foo/Conflicts.pm delete mode 100644 t/lib/06/Foo/Foo.pm delete mode 100644 t/lib/06/Foo/Quux.pm create mode 100644 t/lib/also/Bar/Conflicts.pm create mode 100644 t/lib/also/Bar/Conflicts2.pm create mode 100644 t/lib/also/Foo.pm create mode 100644 t/lib/also/Foo/Conflicts.pm create mode 100644 t/lib/basic/Bar/Conflicts.pm create mode 100644 t/lib/basic/Bar/Conflicts2.pm create mode 100644 t/lib/basic/Bar/Conflicts3.pm create mode 100644 t/lib/basic/Foo/Conflicts.pm create mode 100644 t/lib/conflicts/Bar.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Bad.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Bad2.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Bad3.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Good.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Good2.pm create mode 100644 t/lib/conflicts/Bar/Conflicts/Good3.pm create mode 100644 t/lib/conflicts/Bar/Three.pm create mode 100644 t/lib/conflicts/Bar/Two.pm create mode 100644 t/lib/conflicts/Broken.pm create mode 100644 t/lib/conflicts/Foo.pm create mode 100644 t/lib/conflicts/Foo/Conflicts/Bad.pm create mode 100644 t/lib/conflicts/Foo/Conflicts/Broken.pm create mode 100644 t/lib/conflicts/Foo/Conflicts/Good.pm create mode 100644 t/lib/conflicts/Foo/Three.pm create mode 100644 t/lib/conflicts/Foo/Two.pm create mode 100644 t/lib/dist/Bar.pm create mode 100644 t/lib/dist/Bar/Conflicts/Bad.pm create mode 100644 t/lib/dist/Bar/Conflicts/Bad2.pm create mode 100644 t/lib/dist/Bar/Conflicts/Bad3.pm create mode 100644 t/lib/dist/Bar/Conflicts/Good.pm create mode 100644 t/lib/dist/Bar/Conflicts/Good2.pm create mode 100644 t/lib/dist/Bar/Conflicts/Good3.pm create mode 100644 t/lib/dist/Bar/Three.pm create mode 100644 t/lib/dist/Bar/Two.pm create mode 100644 t/lib/dist/Foo.pm create mode 100644 t/lib/dist/Foo/Conflicts/Bad.pm create mode 100644 t/lib/dist/Foo/Conflicts/Good.pm create mode 100644 t/lib/dist/Foo/Three.pm create mode 100644 t/lib/dist/Foo/Two.pm create mode 100644 t/lib/merge/Foo/Conflicts.pm create mode 100644 t/lib/merge/Foo/Conflicts2.pm create mode 100644 t/lib/runtime/Bar.pm create mode 100644 t/lib/runtime/Bar/Bar.pm create mode 100644 t/lib/runtime/Bar/Bar/Bad.pm create mode 100644 t/lib/runtime/Bar/Bar/Good.pm create mode 100644 t/lib/runtime/Bar/Baz.pm create mode 100644 t/lib/runtime/Bar/Baz/Bad.pm create mode 100644 t/lib/runtime/Bar/Baz/Good.pm create mode 100644 t/lib/runtime/Bar/Conflicts.pm create mode 100644 t/lib/runtime/Bar/Foo.pm create mode 100644 t/lib/runtime/Bar/Foo/Bad.pm create mode 100644 t/lib/runtime/Bar/Foo/Good.pm create mode 100644 t/lib/runtime/Bar/Quux.pm create mode 100644 t/lib/runtime/Bar/Quux/Bad.pm create mode 100644 t/lib/runtime/Bar/Quux/Good.pm create mode 100644 t/lib/runtime/Foo.pm create mode 100644 t/lib/runtime/Foo/Bar.pm create mode 100644 t/lib/runtime/Foo/Baz.pm create mode 100644 t/lib/runtime/Foo/Conflicts.pm create mode 100644 t/lib/runtime/Foo/Foo.pm create mode 100644 t/lib/runtime/Foo/Quux.pm create mode 100644 t/merge.t create mode 100644 t/runtime.t diff --git a/t/01-basic.t b/t/01-basic.t deleted file mode 100644 index 41ad8eb..0000000 --- a/t/01-basic.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use Test::More; -use lib 't/lib/01'; - -{ - use_ok('Foo::Conflicts'); - is_deeply( - { Foo::Conflicts->conflicts }, - { - 'Foo::Thing' => '0.01', - 'Foo::Thing::Sub' => '0.05', - }, - "basic conflicts work" - ); -} - -{ - use_ok('Bar::Conflicts'); - is_deeply( - { Bar::Conflicts->conflicts }, - { - 'Bar::Local' => '0.02', - 'Bar::Also' => '0.06', - 'Bar::Also::Also' => '0.12', - }, - "nested conflicts work" - ); - is_deeply( - { Bar::Conflicts2->conflicts }, - { - 'Bar::Also' => '0.06', - 'Bar::Also::Also' => '0.12', - }, - "nested conflicts work" - ); - is_deeply( - { Bar::Conflicts3->conflicts }, - { - 'Bar::Also::Also' => '0.12', - }, - "nested conflicts work" - ); -} - -done_testing; diff --git a/t/02-conflicts.t b/t/02-conflicts.t deleted file mode 100644 index 19cd72b..0000000 --- a/t/02-conflicts.t +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -use Test::More; -use Test::Fatal; -use Test::Warnings 0.005 'warning'; -use lib 't/lib/02'; - -{ - use_ok('Foo::Conflicts::Good'); - is_deeply( - [ Foo::Conflicts::Good->calculate_conflicts ], - [], - "correct versions for all conflicts", - ); - is( - exception { Foo::Conflicts::Good->check_conflicts }, - undef, - "no conflict error" - ); -} - -{ - use_ok('Foo::Conflicts::Bad'); - - is_deeply( - [ Foo::Conflicts::Bad->calculate_conflicts ], - [ - { package => 'Foo', installed => '0.02', required => '0.03' }, - { package => 'Foo::Two', installed => '0.02', required => '0.02' }, - ], - "correct versions for all conflicts", - ); - is( - exception { Foo::Conflicts::Bad->check_conflicts }, - "Conflicts detected for Foo::Conflicts::Bad:\n Foo is version 0.02, but must be greater than version 0.03\n Foo::Two is version 0.02, but must be greater than version 0.02\n", - "correct conflict error" - ); -} - -{ - use_ok('Bar::Conflicts::Good'); - is_deeply( - [ Bar::Conflicts::Good->calculate_conflicts ], - [], - "correct versions for all conflicts", - ); - is( - exception { Bar::Conflicts::Good->check_conflicts }, - undef, - "no conflict error" - ); -} - -{ - use_ok('Bar::Conflicts::Bad'); - - is_deeply( - [ Bar::Conflicts::Bad->calculate_conflicts ], - [ - { package => 'Bar', installed => '0.02', required => '0.03' }, - { package => 'Bar::Two', installed => '0.02', required => '0.02' }, - ], - "correct versions for all conflicts", - ); - is( - exception { Bar::Conflicts::Bad->check_conflicts }, - "Conflicts detected for Bar::Conflicts::Bad:\n Bar is version 0.02, but must be greater than version 0.03\n Bar::Two is version 0.02, but must be greater than version 0.02\n", - "correct conflict error" - ); -} - -{ - # conflicting module is utterly broken - - use_ok('Foo::Conflicts::Broken'); - - my @conflicts; - like warning { @conflicts = Foo::Conflicts::Broken->calculate_conflicts }, - qr/Warning: Broken did not compile/, - 'Warning is issued when Broken fails to compile'; - - is_deeply( - \@conflicts, - [ - { package => 'Broken', installed => 'unknown', required => '0.03' }, - ], - "correct versions for all conflicts", - ); - - like warning { - like( - exception { Foo::Conflicts::Broken->check_conflicts }, - qr/^Conflicts detected for Foo::Conflicts::Broken:\n Broken is version unknown, but must be greater than version 0.03\n/, - "correct conflict error", - ); - }, - qr/Warning: Broken did not compile/, - 'Warning is also issued when Broken fails to compile', - ; -} - -done_testing; diff --git a/t/03-dist.t b/t/03-dist.t deleted file mode 100644 index c40e22c..0000000 --- a/t/03-dist.t +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use Test::More; -use Test::Fatal; -use lib 't/lib/03'; - -{ - use_ok('Foo::Conflicts::Good'); - is_deeply( - [ Foo::Conflicts::Good->calculate_conflicts ], - [], - "correct versions for all conflicts", - ); - is( - exception { Foo::Conflicts::Good->check_conflicts }, - undef, - "no conflict error" - ); - is(Foo::Conflicts::Good->dist, 'Foo', "correct dist"); -} - -{ - use_ok('Foo::Conflicts::Bad'); - - is_deeply( - [ Foo::Conflicts::Bad->calculate_conflicts ], - [ - { package => 'Foo', installed => '0.02', required => '0.03' }, - { package => 'Foo::Two', installed => '0.02', required => '0.02' }, - ], - "correct versions for all conflicts", - ); - is( - exception { Foo::Conflicts::Bad->check_conflicts }, - "Conflicts detected for Foo:\n Foo is version 0.02, but must be greater than version 0.03\n Foo::Two is version 0.02, but must be greater than version 0.02\n", - "correct conflict error" - ); - is(Foo::Conflicts::Bad->dist, 'Foo', "correct dist"); -} - -{ - use_ok('Bar::Conflicts::Good'); - is_deeply( - [ Bar::Conflicts::Good->calculate_conflicts ], - [], - "correct versions for all conflicts", - ); - is( - exception { Bar::Conflicts::Good->check_conflicts }, - undef, - "no conflict error" - ); - is(Bar::Conflicts::Good->dist, 'Bar', "correct dist"); -} - -{ - use_ok('Bar::Conflicts::Bad'); - - is_deeply( - [ Bar::Conflicts::Bad->calculate_conflicts ], - [ - { package => 'Bar', installed => '0.02', required => '0.03' }, - { package => 'Bar::Two', installed => '0.02', required => '0.02' }, - ], - "correct versions for all conflicts", - ); - is( - exception { Bar::Conflicts::Bad->check_conflicts }, - "Conflicts detected for Bar:\n Bar is version 0.02, but must be greater than version 0.03\n Bar::Two is version 0.02, but must be greater than version 0.02\n", - "correct conflict error" - ); - is(Bar::Conflicts::Bad->dist, 'Bar', "correct dist"); -} - -done_testing; diff --git a/t/04-merge.t b/t/04-merge.t deleted file mode 100644 index 9c0f3b6..0000000 --- a/t/04-merge.t +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use Test::More; -use lib 't/lib/04'; - -{ - use_ok('Foo::Conflicts'); - is_deeply( - { Foo::Conflicts->conflicts }, - { - 'Foo::One' => '0.03', - 'Foo::Two' => '0.03', - 'Foo::Three' => '0.02', - 'Foo::Four' => '0.02', - }, - "got the right conflicts" - ); -} - -done_testing; diff --git a/t/05-also.t b/t/05-also.t deleted file mode 100644 index 286f8fa..0000000 --- a/t/05-also.t +++ /dev/null @@ -1,32 +0,0 @@ -#!/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/06-runtime.t b/t/06-runtime.t deleted file mode 100644 index d3c210f..0000000 --- a/t/06-runtime.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use Test::More; -use lib 't/lib/06'; - -sub use_ok_warnings { - my ($class, @conflicts) = @_; - local $Test::Builder::Level = $Test::Builder::Level + 1; - @conflicts = sort map { "Conflict detected for $_->[0]:\n $_->[1] is version $_->[2], but must be greater than version $_->[3]\n" } @conflicts; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings, $_[0] }; - use_ok($class); - } - @warnings = sort @warnings; - - is_deeply(\@warnings, \@conflicts, "correct runtime warnings for $class"); -} - -use_ok_warnings( - 'Foo', - ['Foo::Conflicts', 'Foo::Foo', '0.01', '0.01'], - ['Foo::Conflicts', 'Foo::Bar', '0.01', '0.01'], -); -use_ok_warnings( - 'Bar', - ['Bar::Conflicts', 'Bar::Baz::Bad', '0.01', '0.01'], - ['Bar::Conflicts', 'Bar::Foo::Bad', '0.01', '0.01'], - ['Bar::Conflicts', 'Bar::Foo', '0.01', '0.01'], - ['Bar::Conflicts', 'Bar::Bar::Bad', '0.01', '0.01'], - ['Bar::Conflicts', 'Bar::Bar', '0.01', '0.01'], - ['Bar::Conflicts', 'Bar::Quux::Bad', '0.01', '0.01'], -); - -is(Bar::Foo->contents, "__DATA__ for Bar::Foo\n", "__DATA__ sections intact"); -is(Bar::Bar->contents, "__DATA__ for Bar::Bar\n", "__DATA__ sections intact"); -is(Bar::Baz->contents, "__DATA__ for Bar::Baz\n", "__DATA__ sections intact"); -is(Bar::Quux->contents, "__DATA__ for Bar::Quux\n", "__DATA__ sections intact"); - -is(scalar(grep { ref($_) eq 'ARRAY' && @$_ > 1 && ref($_->[1]) eq 'HASH' } - @INC), - 1, - "only installed one \@INC hook"); - -done_testing; diff --git a/t/also.t b/t/also.t new file mode 100644 index 0000000..285a5aa --- /dev/null +++ b/t/also.t @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Test::Fatal; +use lib 't/lib/also'; + +{ + 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/basic.t b/t/basic.t new file mode 100644 index 0000000..c1bf2aa --- /dev/null +++ b/t/basic.t @@ -0,0 +1,47 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use lib 't/lib/basic'; + +{ + use_ok('Foo::Conflicts'); + is_deeply( + { Foo::Conflicts->conflicts }, + { + 'Foo::Thing' => '0.01', + 'Foo::Thing::Sub' => '0.05', + }, + "basic conflicts work" + ); +} + +{ + use_ok('Bar::Conflicts'); + is_deeply( + { Bar::Conflicts->conflicts }, + { + 'Bar::Local' => '0.02', + 'Bar::Also' => '0.06', + 'Bar::Also::Also' => '0.12', + }, + "nested conflicts work" + ); + is_deeply( + { Bar::Conflicts2->conflicts }, + { + 'Bar::Also' => '0.06', + 'Bar::Also::Also' => '0.12', + }, + "nested conflicts work" + ); + is_deeply( + { Bar::Conflicts3->conflicts }, + { + 'Bar::Also::Also' => '0.12', + }, + "nested conflicts work" + ); +} + +done_testing; diff --git a/t/conflicts.t b/t/conflicts.t new file mode 100644 index 0000000..cc9afc6 --- /dev/null +++ b/t/conflicts.t @@ -0,0 +1,104 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use Test::More; +use Test::Fatal; +use Test::Warnings 0.005 'warning'; +use lib 't/lib/conflicts'; + +{ + use_ok('Foo::Conflicts::Good'); + is_deeply( + [ Foo::Conflicts::Good->calculate_conflicts ], + [], + "correct versions for all conflicts", + ); + is( + exception { Foo::Conflicts::Good->check_conflicts }, + undef, + "no conflict error" + ); +} + +{ + use_ok('Foo::Conflicts::Bad'); + + is_deeply( + [ Foo::Conflicts::Bad->calculate_conflicts ], + [ + { package => 'Foo', installed => '0.02', required => '0.03' }, + { package => 'Foo::Two', installed => '0.02', required => '0.02' }, + ], + "correct versions for all conflicts", + ); + is( + exception { Foo::Conflicts::Bad->check_conflicts }, + "Conflicts detected for Foo::Conflicts::Bad:\n Foo is version 0.02, but must be greater than version 0.03\n Foo::Two is version 0.02, but must be greater than version 0.02\n", + "correct conflict error" + ); +} + +{ + use_ok('Bar::Conflicts::Good'); + is_deeply( + [ Bar::Conflicts::Good->calculate_conflicts ], + [], + "correct versions for all conflicts", + ); + is( + exception { Bar::Conflicts::Good->check_conflicts }, + undef, + "no conflict error" + ); +} + +{ + use_ok('Bar::Conflicts::Bad'); + + is_deeply( + [ Bar::Conflicts::Bad->calculate_conflicts ], + [ + { package => 'Bar', installed => '0.02', required => '0.03' }, + { package => 'Bar::Two', installed => '0.02', required => '0.02' }, + ], + "correct versions for all conflicts", + ); + is( + exception { Bar::Conflicts::Bad->check_conflicts }, + "Conflicts detected for Bar::Conflicts::Bad:\n Bar is version 0.02, but must be greater than version 0.03\n Bar::Two is version 0.02, but must be greater than version 0.02\n", + "correct conflict error" + ); +} + +{ + # conflicting module is utterly broken + + use_ok('Foo::Conflicts::Broken'); + + my @conflicts; + like warning { @conflicts = Foo::Conflicts::Broken->calculate_conflicts }, + qr/Warning: Broken did not compile/, + 'Warning is issued when Broken fails to compile'; + + is_deeply( + \@conflicts, + [ + { package => 'Broken', installed => 'unknown', required => '0.03' }, + ], + "correct versions for all conflicts", + ); + + like warning { + like( + exception { Foo::Conflicts::Broken->check_conflicts }, + qr/^Conflicts detected for Foo::Conflicts::Broken:\n Broken is version unknown, but must be greater than version 0.03\n/, + "correct conflict error", + ); + }, + qr/Warning: Broken did not compile/, + 'Warning is also issued when Broken fails to compile', + ; +} + +done_testing; diff --git a/t/dist.t b/t/dist.t new file mode 100644 index 0000000..c3a7823 --- /dev/null +++ b/t/dist.t @@ -0,0 +1,76 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Test::Fatal; +use lib 't/lib/dist'; + +{ + use_ok('Foo::Conflicts::Good'); + is_deeply( + [ Foo::Conflicts::Good->calculate_conflicts ], + [], + "correct versions for all conflicts", + ); + is( + exception { Foo::Conflicts::Good->check_conflicts }, + undef, + "no conflict error" + ); + is(Foo::Conflicts::Good->dist, 'Foo', "correct dist"); +} + +{ + use_ok('Foo::Conflicts::Bad'); + + is_deeply( + [ Foo::Conflicts::Bad->calculate_conflicts ], + [ + { package => 'Foo', installed => '0.02', required => '0.03' }, + { package => 'Foo::Two', installed => '0.02', required => '0.02' }, + ], + "correct versions for all conflicts", + ); + is( + exception { Foo::Conflicts::Bad->check_conflicts }, + "Conflicts detected for Foo:\n Foo is version 0.02, but must be greater than version 0.03\n Foo::Two is version 0.02, but must be greater than version 0.02\n", + "correct conflict error" + ); + is(Foo::Conflicts::Bad->dist, 'Foo', "correct dist"); +} + +{ + use_ok('Bar::Conflicts::Good'); + is_deeply( + [ Bar::Conflicts::Good->calculate_conflicts ], + [], + "correct versions for all conflicts", + ); + is( + exception { Bar::Conflicts::Good->check_conflicts }, + undef, + "no conflict error" + ); + is(Bar::Conflicts::Good->dist, 'Bar', "correct dist"); +} + +{ + use_ok('Bar::Conflicts::Bad'); + + is_deeply( + [ Bar::Conflicts::Bad->calculate_conflicts ], + [ + { package => 'Bar', installed => '0.02', required => '0.03' }, + { package => 'Bar::Two', installed => '0.02', required => '0.02' }, + ], + "correct versions for all conflicts", + ); + is( + exception { Bar::Conflicts::Bad->check_conflicts }, + "Conflicts detected for Bar:\n Bar is version 0.02, but must be greater than version 0.03\n Bar::Two is version 0.02, but must be greater than version 0.02\n", + "correct conflict error" + ); + is(Bar::Conflicts::Bad->dist, 'Bar', "correct dist"); +} + +done_testing; diff --git a/t/lib/01/Bar/Conflicts.pm b/t/lib/01/Bar/Conflicts.pm deleted file mode 100644 index 65ba026..0000000 --- a/t/lib/01/Bar/Conflicts.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Local' => 0.02, - }, - -also => [ - 'Bar::Conflicts2', - ]; - -1; diff --git a/t/lib/01/Bar/Conflicts2.pm b/t/lib/01/Bar/Conflicts2.pm deleted file mode 100644 index a26606c..0000000 --- a/t/lib/01/Bar/Conflicts2.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts2; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Also' => 0.06, - }, - -also => [ - 'Bar::Conflicts3', - ]; - -1; diff --git a/t/lib/01/Bar/Conflicts3.pm b/t/lib/01/Bar/Conflicts3.pm deleted file mode 100644 index 4c30909..0000000 --- a/t/lib/01/Bar/Conflicts3.pm +++ /dev/null @@ -1,10 +0,0 @@ -package Bar::Conflicts3; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Also::Also' => 0.12, - }; - -1; diff --git a/t/lib/01/Foo/Conflicts.pm b/t/lib/01/Foo/Conflicts.pm deleted file mode 100644 index 0d9d7ef..0000000 --- a/t/lib/01/Foo/Conflicts.pm +++ /dev/null @@ -1,11 +0,0 @@ -package Foo::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo::Thing' => 0.01, - 'Foo::Thing::Sub' => 0.05, - }; - -1; diff --git a/t/lib/02/Bar.pm b/t/lib/02/Bar.pm deleted file mode 100644 index 0ce51ad..0000000 --- a/t/lib/02/Bar.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/02/Bar/Conflicts/Bad.pm b/t/lib/02/Bar/Conflicts/Bad.pm deleted file mode 100644 index 32a654e..0000000 --- a/t/lib/02/Bar/Conflicts/Bad.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts::Bad; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar' => '0.03', - }, - -also => [ - 'Bar::Conflicts::Bad2', - ]; - -1; diff --git a/t/lib/02/Bar/Conflicts/Bad2.pm b/t/lib/02/Bar/Conflicts/Bad2.pm deleted file mode 100644 index 9c76862..0000000 --- a/t/lib/02/Bar/Conflicts/Bad2.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts::Bad2; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Two' => '0.02', - }, - -also => [ - 'Bar::Conflicts::Bad3', - ]; - -1; diff --git a/t/lib/02/Bar/Conflicts/Bad3.pm b/t/lib/02/Bar/Conflicts/Bad3.pm deleted file mode 100644 index fb80b9e..0000000 --- a/t/lib/02/Bar/Conflicts/Bad3.pm +++ /dev/null @@ -1,10 +0,0 @@ -package Bar::Conflicts::Bad3; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Three' => '0.01', - }; - -1; diff --git a/t/lib/02/Bar/Conflicts/Good.pm b/t/lib/02/Bar/Conflicts/Good.pm deleted file mode 100644 index 0f74447..0000000 --- a/t/lib/02/Bar/Conflicts/Good.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts::Good; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar' => '0.01', - }, - -also => [ - 'Bar::Conflicts::Good2', - ]; - -1; diff --git a/t/lib/02/Bar/Conflicts/Good2.pm b/t/lib/02/Bar/Conflicts/Good2.pm deleted file mode 100644 index 8ba9fd3..0000000 --- a/t/lib/02/Bar/Conflicts/Good2.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar::Conflicts::Good2; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Two' => '0.01', - }, - -also => [ - 'Bar::Conflicts::Good3', - ]; - -1; diff --git a/t/lib/02/Bar/Conflicts/Good3.pm b/t/lib/02/Bar/Conflicts/Good3.pm deleted file mode 100644 index 88b542e..0000000 --- a/t/lib/02/Bar/Conflicts/Good3.pm +++ /dev/null @@ -1,10 +0,0 @@ -package Bar::Conflicts::Good3; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Bar::Three' => '0.01', - }; - -1; diff --git a/t/lib/02/Bar/Three.pm b/t/lib/02/Bar/Three.pm deleted file mode 100644 index 8c304fe..0000000 --- a/t/lib/02/Bar/Three.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Three; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/02/Bar/Two.pm b/t/lib/02/Bar/Two.pm deleted file mode 100644 index 172ad51..0000000 --- a/t/lib/02/Bar/Two.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Two; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/02/Broken.pm b/t/lib/02/Broken.pm deleted file mode 100644 index de400c3..0000000 --- a/t/lib/02/Broken.pm +++ /dev/null @@ -1,3 +0,0 @@ -package Broken; - -die 'this module is utterly broken'; diff --git a/t/lib/02/Foo.pm b/t/lib/02/Foo.pm deleted file mode 100644 index 9660e6d..0000000 --- a/t/lib/02/Foo.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/02/Foo/Conflicts/Bad.pm b/t/lib/02/Foo/Conflicts/Bad.pm deleted file mode 100644 index 1cbf30f..0000000 --- a/t/lib/02/Foo/Conflicts/Bad.pm +++ /dev/null @@ -1,12 +0,0 @@ -package Foo::Conflicts::Bad; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo' => 0.03, - 'Foo::Two' => 0.02, - 'Foo::Three' => 0.01, - }; - -1; diff --git a/t/lib/02/Foo/Conflicts/Broken.pm b/t/lib/02/Foo/Conflicts/Broken.pm deleted file mode 100644 index 87043ae..0000000 --- a/t/lib/02/Foo/Conflicts/Broken.pm +++ /dev/null @@ -1,11 +0,0 @@ -package Foo::Conflicts::Broken; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Broken' => '0.03', - 'NotInstalled' => '0.01', - }; - -1; diff --git a/t/lib/02/Foo/Conflicts/Good.pm b/t/lib/02/Foo/Conflicts/Good.pm deleted file mode 100644 index 33d15de..0000000 --- a/t/lib/02/Foo/Conflicts/Good.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Foo::Conflicts::Good; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo' => 0.01, - 'Foo::Two' => 0.01, - 'Foo::Three' => 0.01, - 'NotInstalled' => '0.01', - }; - -1; diff --git a/t/lib/02/Foo/Three.pm b/t/lib/02/Foo/Three.pm deleted file mode 100644 index b180934..0000000 --- a/t/lib/02/Foo/Three.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Three; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/02/Foo/Two.pm b/t/lib/02/Foo/Two.pm deleted file mode 100644 index 7a1daff..0000000 --- a/t/lib/02/Foo/Two.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Two; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Bar.pm b/t/lib/03/Bar.pm deleted file mode 100644 index 0ce51ad..0000000 --- a/t/lib/03/Bar.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Bar/Conflicts/Bad.pm b/t/lib/03/Bar/Conflicts/Bad.pm deleted file mode 100644 index af25aab..0000000 --- a/t/lib/03/Bar/Conflicts/Bad.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Bar::Conflicts::Bad; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar' => '0.03', - }, - -also => [ - 'Bar::Conflicts::Bad2', - ]; - -1; diff --git a/t/lib/03/Bar/Conflicts/Bad2.pm b/t/lib/03/Bar/Conflicts/Bad2.pm deleted file mode 100644 index c4f1c1a..0000000 --- a/t/lib/03/Bar/Conflicts/Bad2.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Bar::Conflicts::Bad2; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar::Two' => '0.02', - }, - -also => [ - 'Bar::Conflicts::Bad3', - ]; - -1; diff --git a/t/lib/03/Bar/Conflicts/Bad3.pm b/t/lib/03/Bar/Conflicts/Bad3.pm deleted file mode 100644 index be23e3c..0000000 --- a/t/lib/03/Bar/Conflicts/Bad3.pm +++ /dev/null @@ -1,11 +0,0 @@ -package Bar::Conflicts::Bad3; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar::Three' => '0.01', - }; - -1; diff --git a/t/lib/03/Bar/Conflicts/Good.pm b/t/lib/03/Bar/Conflicts/Good.pm deleted file mode 100644 index cd64e57..0000000 --- a/t/lib/03/Bar/Conflicts/Good.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Bar::Conflicts::Good; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar' => '0.01', - }, - -also => [ - 'Bar::Conflicts::Good2', - ]; - -1; diff --git a/t/lib/03/Bar/Conflicts/Good2.pm b/t/lib/03/Bar/Conflicts/Good2.pm deleted file mode 100644 index ed98ddc..0000000 --- a/t/lib/03/Bar/Conflicts/Good2.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Bar::Conflicts::Good2; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar::Two' => '0.01', - }, - -also => [ - 'Bar::Conflicts::Good3', - ]; - -1; diff --git a/t/lib/03/Bar/Conflicts/Good3.pm b/t/lib/03/Bar/Conflicts/Good3.pm deleted file mode 100644 index 7bb0943..0000000 --- a/t/lib/03/Bar/Conflicts/Good3.pm +++ /dev/null @@ -1,11 +0,0 @@ -package Bar::Conflicts::Good3; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Bar', - -conflicts => { - 'Bar::Three' => '0.01', - }; - -1; diff --git a/t/lib/03/Bar/Three.pm b/t/lib/03/Bar/Three.pm deleted file mode 100644 index 8c304fe..0000000 --- a/t/lib/03/Bar/Three.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Three; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Bar/Two.pm b/t/lib/03/Bar/Two.pm deleted file mode 100644 index 172ad51..0000000 --- a/t/lib/03/Bar/Two.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Two; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Foo.pm b/t/lib/03/Foo.pm deleted file mode 100644 index 9660e6d..0000000 --- a/t/lib/03/Foo.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Foo/Conflicts/Bad.pm b/t/lib/03/Foo/Conflicts/Bad.pm deleted file mode 100644 index 22905ee..0000000 --- a/t/lib/03/Foo/Conflicts/Bad.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Foo::Conflicts::Bad; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Foo', - -conflicts => { - 'Foo' => 0.03, - 'Foo::Two' => 0.02, - 'Foo::Three' => 0.01, - }; - -1; diff --git a/t/lib/03/Foo/Conflicts/Good.pm b/t/lib/03/Foo/Conflicts/Good.pm deleted file mode 100644 index 553c698..0000000 --- a/t/lib/03/Foo/Conflicts/Good.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Foo::Conflicts::Good; -use strict; -use warnings; - -use Dist::CheckConflicts - -dist => 'Foo', - -conflicts => { - 'Foo' => 0.01, - 'Foo::Two' => 0.01, - 'Foo::Three' => 0.01, - }; - -1; diff --git a/t/lib/03/Foo/Three.pm b/t/lib/03/Foo/Three.pm deleted file mode 100644 index b180934..0000000 --- a/t/lib/03/Foo/Three.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Three; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/03/Foo/Two.pm b/t/lib/03/Foo/Two.pm deleted file mode 100644 index 7a1daff..0000000 --- a/t/lib/03/Foo/Two.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Two; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/04/Foo/Conflicts.pm b/t/lib/04/Foo/Conflicts.pm deleted file mode 100644 index 3691702..0000000 --- a/t/lib/04/Foo/Conflicts.pm +++ /dev/null @@ -1,15 +0,0 @@ -package Foo::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo::One' => 0.01, - 'Foo::Two' => 0.03, - 'Foo::Three' => 0.02, - }, - -also => [ - 'Foo::Conflicts2', - ]; - -1; diff --git a/t/lib/04/Foo/Conflicts2.pm b/t/lib/04/Foo/Conflicts2.pm deleted file mode 100644 index b782a2b..0000000 --- a/t/lib/04/Foo/Conflicts2.pm +++ /dev/null @@ -1,12 +0,0 @@ -package Foo::Conflicts2; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo::One' => 0.03, - 'Foo::Two' => 0.01, - 'Foo::Four' => 0.02, - }; - -1; diff --git a/t/lib/05/Bar/Conflicts.pm b/t/lib/05/Bar/Conflicts.pm deleted file mode 100644 index ffeb56a..0000000 --- a/t/lib/05/Bar/Conflicts.pm +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index d45754e..0000000 --- a/t/lib/05/Bar/Conflicts2.pm +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 8c4dc16..0000000 --- a/t/lib/05/Foo.pm +++ /dev/null @@ -1,5 +0,0 @@ -package Foo; - -sub foo { } - -1; diff --git a/t/lib/05/Foo/Conflicts.pm b/t/lib/05/Foo/Conflicts.pm deleted file mode 100644 index 0d9d7ef..0000000 --- a/t/lib/05/Foo/Conflicts.pm +++ /dev/null @@ -1,11 +0,0 @@ -package Foo::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - -conflicts => { - 'Foo::Thing' => 0.01, - 'Foo::Thing::Sub' => 0.05, - }; - -1; diff --git a/t/lib/06/Bar.pm b/t/lib/06/Bar.pm deleted file mode 100644 index 8691a44..0000000 --- a/t/lib/06/Bar.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Bar; -use strict; -use warnings; - -use Bar::Foo; -use Bar::Baz; - -use Bar::Conflicts; - -use Bar::Bar; -use Bar::Quux; - -1; diff --git a/t/lib/06/Bar/Bar.pm b/t/lib/06/Bar/Bar.pm deleted file mode 100644 index d532db6..0000000 --- a/t/lib/06/Bar/Bar.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Bar::Bar; -use strict; -use warnings; - -use Bar::Bar::Good; -use Bar::Bar::Bad; - -our $VERSION = 0.01; - -sub contents { - local $/; - -} - -1; - -__DATA__ -__DATA__ for Bar::Bar diff --git a/t/lib/06/Bar/Bar/Bad.pm b/t/lib/06/Bar/Bar/Bad.pm deleted file mode 100644 index 9a4792b..0000000 --- a/t/lib/06/Bar/Bar/Bad.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Bar::Bad; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Bar/Bar/Good.pm b/t/lib/06/Bar/Bar/Good.pm deleted file mode 100644 index 58e6d78..0000000 --- a/t/lib/06/Bar/Bar/Good.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Bar::Good; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/06/Bar/Baz.pm b/t/lib/06/Bar/Baz.pm deleted file mode 100644 index b4db03b..0000000 --- a/t/lib/06/Bar/Baz.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Bar::Baz; -use strict; -use warnings; - -use Bar::Baz::Good; -use Bar::Baz::Bad; - -our $VERSION = 0.02; - -sub contents { - local $/; - -} - -1; - -__DATA__ -__DATA__ for Bar::Baz diff --git a/t/lib/06/Bar/Baz/Bad.pm b/t/lib/06/Bar/Baz/Bad.pm deleted file mode 100644 index c92da0e..0000000 --- a/t/lib/06/Bar/Baz/Bad.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Baz::Bad; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Bar/Baz/Good.pm b/t/lib/06/Bar/Baz/Good.pm deleted file mode 100644 index 2205717..0000000 --- a/t/lib/06/Bar/Baz/Good.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Baz::Good; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/06/Bar/Conflicts.pm b/t/lib/06/Bar/Conflicts.pm deleted file mode 100644 index c9c6f3d..0000000 --- a/t/lib/06/Bar/Conflicts.pm +++ /dev/null @@ -1,22 +0,0 @@ -package Bar::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - ':runtime', - -conflicts => { - 'Bar::Foo' => 0.01, - 'Bar::Foo::Good' => 0.01, - 'Bar::Foo::Bad' => 0.01, - 'Bar::Bar' => 0.01, - 'Bar::Bar::Good' => 0.01, - 'Bar::Bar::Bad' => 0.01, - 'Bar::Baz' => 0.01, - 'Bar::Baz::Good' => 0.01, - 'Bar::Baz::Bad' => 0.01, - 'Bar::Quux' => 0.01, - 'Bar::Quux::Good' => 0.01, - 'Bar::Quux::Bad' => 0.01, - }; - -1; diff --git a/t/lib/06/Bar/Foo.pm b/t/lib/06/Bar/Foo.pm deleted file mode 100644 index 99341ac..0000000 --- a/t/lib/06/Bar/Foo.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Bar::Foo; -use strict; -use warnings; - -use Bar::Foo::Good; -use Bar::Foo::Bad; - -our $VERSION = 0.01; - -sub contents { - local $/; - -} - -1; - -__DATA__ -__DATA__ for Bar::Foo diff --git a/t/lib/06/Bar/Foo/Bad.pm b/t/lib/06/Bar/Foo/Bad.pm deleted file mode 100644 index d4a58d3..0000000 --- a/t/lib/06/Bar/Foo/Bad.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Foo::Bad; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Bar/Foo/Good.pm b/t/lib/06/Bar/Foo/Good.pm deleted file mode 100644 index f5d8b73..0000000 --- a/t/lib/06/Bar/Foo/Good.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Foo::Good; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/06/Bar/Quux.pm b/t/lib/06/Bar/Quux.pm deleted file mode 100644 index 1ec6f35..0000000 --- a/t/lib/06/Bar/Quux.pm +++ /dev/null @@ -1,18 +0,0 @@ -package Bar::Quux; -use strict; -use warnings; - -use Bar::Quux::Good; -use Bar::Quux::Bad; - -our $VERSION = 0.02; - -sub contents { - local $/; - -} - -1; - -__DATA__ -__DATA__ for Bar::Quux diff --git a/t/lib/06/Bar/Quux/Bad.pm b/t/lib/06/Bar/Quux/Bad.pm deleted file mode 100644 index 2238323..0000000 --- a/t/lib/06/Bar/Quux/Bad.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Quux::Bad; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Bar/Quux/Good.pm b/t/lib/06/Bar/Quux/Good.pm deleted file mode 100644 index 8692c2c..0000000 --- a/t/lib/06/Bar/Quux/Good.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Bar::Quux::Good; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/06/Foo.pm b/t/lib/06/Foo.pm deleted file mode 100644 index 5fd77ef..0000000 --- a/t/lib/06/Foo.pm +++ /dev/null @@ -1,13 +0,0 @@ -package Foo; -use strict; -use warnings; - -use Foo::Foo; -use Foo::Baz; - -use Foo::Conflicts; - -use Foo::Bar; -use Foo::Quux; - -1; diff --git a/t/lib/06/Foo/Bar.pm b/t/lib/06/Foo/Bar.pm deleted file mode 100644 index c4c6af8..0000000 --- a/t/lib/06/Foo/Bar.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Bar; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Foo/Baz.pm b/t/lib/06/Foo/Baz.pm deleted file mode 100644 index 665f3b5..0000000 --- a/t/lib/06/Foo/Baz.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Baz; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/06/Foo/Conflicts.pm b/t/lib/06/Foo/Conflicts.pm deleted file mode 100644 index 34ea4b0..0000000 --- a/t/lib/06/Foo/Conflicts.pm +++ /dev/null @@ -1,14 +0,0 @@ -package Foo::Conflicts; -use strict; -use warnings; - -use Dist::CheckConflicts - ':runtime', - -conflicts => { - 'Foo::Foo' => 0.01, - 'Foo::Bar' => 0.01, - 'Foo::Baz' => 0.01, - 'Foo::Quux' => 0.01, - }; - -1; diff --git a/t/lib/06/Foo/Foo.pm b/t/lib/06/Foo/Foo.pm deleted file mode 100644 index ca6c28e..0000000 --- a/t/lib/06/Foo/Foo.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Foo; -use strict; -use warnings; - -our $VERSION = 0.01; - -1; diff --git a/t/lib/06/Foo/Quux.pm b/t/lib/06/Foo/Quux.pm deleted file mode 100644 index f813ae3..0000000 --- a/t/lib/06/Foo/Quux.pm +++ /dev/null @@ -1,7 +0,0 @@ -package Foo::Quux; -use strict; -use warnings; - -our $VERSION = 0.02; - -1; diff --git a/t/lib/also/Bar/Conflicts.pm b/t/lib/also/Bar/Conflicts.pm new file mode 100644 index 0000000..ffeb56a --- /dev/null +++ b/t/lib/also/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/also/Bar/Conflicts2.pm b/t/lib/also/Bar/Conflicts2.pm new file mode 100644 index 0000000..d45754e --- /dev/null +++ b/t/lib/also/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/also/Foo.pm b/t/lib/also/Foo.pm new file mode 100644 index 0000000..8c4dc16 --- /dev/null +++ b/t/lib/also/Foo.pm @@ -0,0 +1,5 @@ +package Foo; + +sub foo { } + +1; diff --git a/t/lib/also/Foo/Conflicts.pm b/t/lib/also/Foo/Conflicts.pm new file mode 100644 index 0000000..0d9d7ef --- /dev/null +++ b/t/lib/also/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; diff --git a/t/lib/basic/Bar/Conflicts.pm b/t/lib/basic/Bar/Conflicts.pm new file mode 100644 index 0000000..65ba026 --- /dev/null +++ b/t/lib/basic/Bar/Conflicts.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Local' => 0.02, + }, + -also => [ + 'Bar::Conflicts2', + ]; + +1; diff --git a/t/lib/basic/Bar/Conflicts2.pm b/t/lib/basic/Bar/Conflicts2.pm new file mode 100644 index 0000000..a26606c --- /dev/null +++ b/t/lib/basic/Bar/Conflicts2.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts2; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Also' => 0.06, + }, + -also => [ + 'Bar::Conflicts3', + ]; + +1; diff --git a/t/lib/basic/Bar/Conflicts3.pm b/t/lib/basic/Bar/Conflicts3.pm new file mode 100644 index 0000000..4c30909 --- /dev/null +++ b/t/lib/basic/Bar/Conflicts3.pm @@ -0,0 +1,10 @@ +package Bar::Conflicts3; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Also::Also' => 0.12, + }; + +1; diff --git a/t/lib/basic/Foo/Conflicts.pm b/t/lib/basic/Foo/Conflicts.pm new file mode 100644 index 0000000..0d9d7ef --- /dev/null +++ b/t/lib/basic/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; diff --git a/t/lib/conflicts/Bar.pm b/t/lib/conflicts/Bar.pm new file mode 100644 index 0000000..0ce51ad --- /dev/null +++ b/t/lib/conflicts/Bar.pm @@ -0,0 +1,7 @@ +package Bar; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Bad.pm b/t/lib/conflicts/Bar/Conflicts/Bad.pm new file mode 100644 index 0000000..32a654e --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Bad.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts::Bad; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar' => '0.03', + }, + -also => [ + 'Bar::Conflicts::Bad2', + ]; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Bad2.pm b/t/lib/conflicts/Bar/Conflicts/Bad2.pm new file mode 100644 index 0000000..9c76862 --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Bad2.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts::Bad2; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Two' => '0.02', + }, + -also => [ + 'Bar::Conflicts::Bad3', + ]; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Bad3.pm b/t/lib/conflicts/Bar/Conflicts/Bad3.pm new file mode 100644 index 0000000..fb80b9e --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Bad3.pm @@ -0,0 +1,10 @@ +package Bar::Conflicts::Bad3; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Three' => '0.01', + }; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Good.pm b/t/lib/conflicts/Bar/Conflicts/Good.pm new file mode 100644 index 0000000..0f74447 --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Good.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts::Good; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar' => '0.01', + }, + -also => [ + 'Bar::Conflicts::Good2', + ]; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Good2.pm b/t/lib/conflicts/Bar/Conflicts/Good2.pm new file mode 100644 index 0000000..8ba9fd3 --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Good2.pm @@ -0,0 +1,13 @@ +package Bar::Conflicts::Good2; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Two' => '0.01', + }, + -also => [ + 'Bar::Conflicts::Good3', + ]; + +1; diff --git a/t/lib/conflicts/Bar/Conflicts/Good3.pm b/t/lib/conflicts/Bar/Conflicts/Good3.pm new file mode 100644 index 0000000..88b542e --- /dev/null +++ b/t/lib/conflicts/Bar/Conflicts/Good3.pm @@ -0,0 +1,10 @@ +package Bar::Conflicts::Good3; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Bar::Three' => '0.01', + }; + +1; diff --git a/t/lib/conflicts/Bar/Three.pm b/t/lib/conflicts/Bar/Three.pm new file mode 100644 index 0000000..8c304fe --- /dev/null +++ b/t/lib/conflicts/Bar/Three.pm @@ -0,0 +1,7 @@ +package Bar::Three; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/conflicts/Bar/Two.pm b/t/lib/conflicts/Bar/Two.pm new file mode 100644 index 0000000..172ad51 --- /dev/null +++ b/t/lib/conflicts/Bar/Two.pm @@ -0,0 +1,7 @@ +package Bar::Two; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/conflicts/Broken.pm b/t/lib/conflicts/Broken.pm new file mode 100644 index 0000000..de400c3 --- /dev/null +++ b/t/lib/conflicts/Broken.pm @@ -0,0 +1,3 @@ +package Broken; + +die 'this module is utterly broken'; diff --git a/t/lib/conflicts/Foo.pm b/t/lib/conflicts/Foo.pm new file mode 100644 index 0000000..9660e6d --- /dev/null +++ b/t/lib/conflicts/Foo.pm @@ -0,0 +1,7 @@ +package Foo; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/conflicts/Foo/Conflicts/Bad.pm b/t/lib/conflicts/Foo/Conflicts/Bad.pm new file mode 100644 index 0000000..1cbf30f --- /dev/null +++ b/t/lib/conflicts/Foo/Conflicts/Bad.pm @@ -0,0 +1,12 @@ +package Foo::Conflicts::Bad; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Foo' => 0.03, + 'Foo::Two' => 0.02, + 'Foo::Three' => 0.01, + }; + +1; diff --git a/t/lib/conflicts/Foo/Conflicts/Broken.pm b/t/lib/conflicts/Foo/Conflicts/Broken.pm new file mode 100644 index 0000000..87043ae --- /dev/null +++ b/t/lib/conflicts/Foo/Conflicts/Broken.pm @@ -0,0 +1,11 @@ +package Foo::Conflicts::Broken; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Broken' => '0.03', + 'NotInstalled' => '0.01', + }; + +1; diff --git a/t/lib/conflicts/Foo/Conflicts/Good.pm b/t/lib/conflicts/Foo/Conflicts/Good.pm new file mode 100644 index 0000000..33d15de --- /dev/null +++ b/t/lib/conflicts/Foo/Conflicts/Good.pm @@ -0,0 +1,13 @@ +package Foo::Conflicts::Good; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Foo' => 0.01, + 'Foo::Two' => 0.01, + 'Foo::Three' => 0.01, + 'NotInstalled' => '0.01', + }; + +1; diff --git a/t/lib/conflicts/Foo/Three.pm b/t/lib/conflicts/Foo/Three.pm new file mode 100644 index 0000000..b180934 --- /dev/null +++ b/t/lib/conflicts/Foo/Three.pm @@ -0,0 +1,7 @@ +package Foo::Three; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/conflicts/Foo/Two.pm b/t/lib/conflicts/Foo/Two.pm new file mode 100644 index 0000000..7a1daff --- /dev/null +++ b/t/lib/conflicts/Foo/Two.pm @@ -0,0 +1,7 @@ +package Foo::Two; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Bar.pm b/t/lib/dist/Bar.pm new file mode 100644 index 0000000..0ce51ad --- /dev/null +++ b/t/lib/dist/Bar.pm @@ -0,0 +1,7 @@ +package Bar; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Bad.pm b/t/lib/dist/Bar/Conflicts/Bad.pm new file mode 100644 index 0000000..af25aab --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Bad.pm @@ -0,0 +1,14 @@ +package Bar::Conflicts::Bad; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar' => '0.03', + }, + -also => [ + 'Bar::Conflicts::Bad2', + ]; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Bad2.pm b/t/lib/dist/Bar/Conflicts/Bad2.pm new file mode 100644 index 0000000..c4f1c1a --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Bad2.pm @@ -0,0 +1,14 @@ +package Bar::Conflicts::Bad2; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar::Two' => '0.02', + }, + -also => [ + 'Bar::Conflicts::Bad3', + ]; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Bad3.pm b/t/lib/dist/Bar/Conflicts/Bad3.pm new file mode 100644 index 0000000..be23e3c --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Bad3.pm @@ -0,0 +1,11 @@ +package Bar::Conflicts::Bad3; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar::Three' => '0.01', + }; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Good.pm b/t/lib/dist/Bar/Conflicts/Good.pm new file mode 100644 index 0000000..cd64e57 --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Good.pm @@ -0,0 +1,14 @@ +package Bar::Conflicts::Good; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar' => '0.01', + }, + -also => [ + 'Bar::Conflicts::Good2', + ]; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Good2.pm b/t/lib/dist/Bar/Conflicts/Good2.pm new file mode 100644 index 0000000..ed98ddc --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Good2.pm @@ -0,0 +1,14 @@ +package Bar::Conflicts::Good2; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar::Two' => '0.01', + }, + -also => [ + 'Bar::Conflicts::Good3', + ]; + +1; diff --git a/t/lib/dist/Bar/Conflicts/Good3.pm b/t/lib/dist/Bar/Conflicts/Good3.pm new file mode 100644 index 0000000..7bb0943 --- /dev/null +++ b/t/lib/dist/Bar/Conflicts/Good3.pm @@ -0,0 +1,11 @@ +package Bar::Conflicts::Good3; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Bar', + -conflicts => { + 'Bar::Three' => '0.01', + }; + +1; diff --git a/t/lib/dist/Bar/Three.pm b/t/lib/dist/Bar/Three.pm new file mode 100644 index 0000000..8c304fe --- /dev/null +++ b/t/lib/dist/Bar/Three.pm @@ -0,0 +1,7 @@ +package Bar::Three; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Bar/Two.pm b/t/lib/dist/Bar/Two.pm new file mode 100644 index 0000000..172ad51 --- /dev/null +++ b/t/lib/dist/Bar/Two.pm @@ -0,0 +1,7 @@ +package Bar::Two; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Foo.pm b/t/lib/dist/Foo.pm new file mode 100644 index 0000000..9660e6d --- /dev/null +++ b/t/lib/dist/Foo.pm @@ -0,0 +1,7 @@ +package Foo; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Foo/Conflicts/Bad.pm b/t/lib/dist/Foo/Conflicts/Bad.pm new file mode 100644 index 0000000..22905ee --- /dev/null +++ b/t/lib/dist/Foo/Conflicts/Bad.pm @@ -0,0 +1,13 @@ +package Foo::Conflicts::Bad; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Foo', + -conflicts => { + 'Foo' => 0.03, + 'Foo::Two' => 0.02, + 'Foo::Three' => 0.01, + }; + +1; diff --git a/t/lib/dist/Foo/Conflicts/Good.pm b/t/lib/dist/Foo/Conflicts/Good.pm new file mode 100644 index 0000000..553c698 --- /dev/null +++ b/t/lib/dist/Foo/Conflicts/Good.pm @@ -0,0 +1,13 @@ +package Foo::Conflicts::Good; +use strict; +use warnings; + +use Dist::CheckConflicts + -dist => 'Foo', + -conflicts => { + 'Foo' => 0.01, + 'Foo::Two' => 0.01, + 'Foo::Three' => 0.01, + }; + +1; diff --git a/t/lib/dist/Foo/Three.pm b/t/lib/dist/Foo/Three.pm new file mode 100644 index 0000000..b180934 --- /dev/null +++ b/t/lib/dist/Foo/Three.pm @@ -0,0 +1,7 @@ +package Foo::Three; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/dist/Foo/Two.pm b/t/lib/dist/Foo/Two.pm new file mode 100644 index 0000000..7a1daff --- /dev/null +++ b/t/lib/dist/Foo/Two.pm @@ -0,0 +1,7 @@ +package Foo::Two; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/merge/Foo/Conflicts.pm b/t/lib/merge/Foo/Conflicts.pm new file mode 100644 index 0000000..3691702 --- /dev/null +++ b/t/lib/merge/Foo/Conflicts.pm @@ -0,0 +1,15 @@ +package Foo::Conflicts; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Foo::One' => 0.01, + 'Foo::Two' => 0.03, + 'Foo::Three' => 0.02, + }, + -also => [ + 'Foo::Conflicts2', + ]; + +1; diff --git a/t/lib/merge/Foo/Conflicts2.pm b/t/lib/merge/Foo/Conflicts2.pm new file mode 100644 index 0000000..b782a2b --- /dev/null +++ b/t/lib/merge/Foo/Conflicts2.pm @@ -0,0 +1,12 @@ +package Foo::Conflicts2; +use strict; +use warnings; + +use Dist::CheckConflicts + -conflicts => { + 'Foo::One' => 0.03, + 'Foo::Two' => 0.01, + 'Foo::Four' => 0.02, + }; + +1; diff --git a/t/lib/runtime/Bar.pm b/t/lib/runtime/Bar.pm new file mode 100644 index 0000000..8691a44 --- /dev/null +++ b/t/lib/runtime/Bar.pm @@ -0,0 +1,13 @@ +package Bar; +use strict; +use warnings; + +use Bar::Foo; +use Bar::Baz; + +use Bar::Conflicts; + +use Bar::Bar; +use Bar::Quux; + +1; diff --git a/t/lib/runtime/Bar/Bar.pm b/t/lib/runtime/Bar/Bar.pm new file mode 100644 index 0000000..d532db6 --- /dev/null +++ b/t/lib/runtime/Bar/Bar.pm @@ -0,0 +1,18 @@ +package Bar::Bar; +use strict; +use warnings; + +use Bar::Bar::Good; +use Bar::Bar::Bad; + +our $VERSION = 0.01; + +sub contents { + local $/; + +} + +1; + +__DATA__ +__DATA__ for Bar::Bar diff --git a/t/lib/runtime/Bar/Bar/Bad.pm b/t/lib/runtime/Bar/Bar/Bad.pm new file mode 100644 index 0000000..9a4792b --- /dev/null +++ b/t/lib/runtime/Bar/Bar/Bad.pm @@ -0,0 +1,7 @@ +package Bar::Bar::Bad; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Bar/Bar/Good.pm b/t/lib/runtime/Bar/Bar/Good.pm new file mode 100644 index 0000000..58e6d78 --- /dev/null +++ b/t/lib/runtime/Bar/Bar/Good.pm @@ -0,0 +1,7 @@ +package Bar::Bar::Good; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/runtime/Bar/Baz.pm b/t/lib/runtime/Bar/Baz.pm new file mode 100644 index 0000000..b4db03b --- /dev/null +++ b/t/lib/runtime/Bar/Baz.pm @@ -0,0 +1,18 @@ +package Bar::Baz; +use strict; +use warnings; + +use Bar::Baz::Good; +use Bar::Baz::Bad; + +our $VERSION = 0.02; + +sub contents { + local $/; + +} + +1; + +__DATA__ +__DATA__ for Bar::Baz diff --git a/t/lib/runtime/Bar/Baz/Bad.pm b/t/lib/runtime/Bar/Baz/Bad.pm new file mode 100644 index 0000000..c92da0e --- /dev/null +++ b/t/lib/runtime/Bar/Baz/Bad.pm @@ -0,0 +1,7 @@ +package Bar::Baz::Bad; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Bar/Baz/Good.pm b/t/lib/runtime/Bar/Baz/Good.pm new file mode 100644 index 0000000..2205717 --- /dev/null +++ b/t/lib/runtime/Bar/Baz/Good.pm @@ -0,0 +1,7 @@ +package Bar::Baz::Good; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/runtime/Bar/Conflicts.pm b/t/lib/runtime/Bar/Conflicts.pm new file mode 100644 index 0000000..c9c6f3d --- /dev/null +++ b/t/lib/runtime/Bar/Conflicts.pm @@ -0,0 +1,22 @@ +package Bar::Conflicts; +use strict; +use warnings; + +use Dist::CheckConflicts + ':runtime', + -conflicts => { + 'Bar::Foo' => 0.01, + 'Bar::Foo::Good' => 0.01, + 'Bar::Foo::Bad' => 0.01, + 'Bar::Bar' => 0.01, + 'Bar::Bar::Good' => 0.01, + 'Bar::Bar::Bad' => 0.01, + 'Bar::Baz' => 0.01, + 'Bar::Baz::Good' => 0.01, + 'Bar::Baz::Bad' => 0.01, + 'Bar::Quux' => 0.01, + 'Bar::Quux::Good' => 0.01, + 'Bar::Quux::Bad' => 0.01, + }; + +1; diff --git a/t/lib/runtime/Bar/Foo.pm b/t/lib/runtime/Bar/Foo.pm new file mode 100644 index 0000000..99341ac --- /dev/null +++ b/t/lib/runtime/Bar/Foo.pm @@ -0,0 +1,18 @@ +package Bar::Foo; +use strict; +use warnings; + +use Bar::Foo::Good; +use Bar::Foo::Bad; + +our $VERSION = 0.01; + +sub contents { + local $/; + +} + +1; + +__DATA__ +__DATA__ for Bar::Foo diff --git a/t/lib/runtime/Bar/Foo/Bad.pm b/t/lib/runtime/Bar/Foo/Bad.pm new file mode 100644 index 0000000..d4a58d3 --- /dev/null +++ b/t/lib/runtime/Bar/Foo/Bad.pm @@ -0,0 +1,7 @@ +package Bar::Foo::Bad; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Bar/Foo/Good.pm b/t/lib/runtime/Bar/Foo/Good.pm new file mode 100644 index 0000000..f5d8b73 --- /dev/null +++ b/t/lib/runtime/Bar/Foo/Good.pm @@ -0,0 +1,7 @@ +package Bar::Foo::Good; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/runtime/Bar/Quux.pm b/t/lib/runtime/Bar/Quux.pm new file mode 100644 index 0000000..1ec6f35 --- /dev/null +++ b/t/lib/runtime/Bar/Quux.pm @@ -0,0 +1,18 @@ +package Bar::Quux; +use strict; +use warnings; + +use Bar::Quux::Good; +use Bar::Quux::Bad; + +our $VERSION = 0.02; + +sub contents { + local $/; + +} + +1; + +__DATA__ +__DATA__ for Bar::Quux diff --git a/t/lib/runtime/Bar/Quux/Bad.pm b/t/lib/runtime/Bar/Quux/Bad.pm new file mode 100644 index 0000000..2238323 --- /dev/null +++ b/t/lib/runtime/Bar/Quux/Bad.pm @@ -0,0 +1,7 @@ +package Bar::Quux::Bad; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Bar/Quux/Good.pm b/t/lib/runtime/Bar/Quux/Good.pm new file mode 100644 index 0000000..8692c2c --- /dev/null +++ b/t/lib/runtime/Bar/Quux/Good.pm @@ -0,0 +1,7 @@ +package Bar::Quux::Good; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/runtime/Foo.pm b/t/lib/runtime/Foo.pm new file mode 100644 index 0000000..5fd77ef --- /dev/null +++ b/t/lib/runtime/Foo.pm @@ -0,0 +1,13 @@ +package Foo; +use strict; +use warnings; + +use Foo::Foo; +use Foo::Baz; + +use Foo::Conflicts; + +use Foo::Bar; +use Foo::Quux; + +1; diff --git a/t/lib/runtime/Foo/Bar.pm b/t/lib/runtime/Foo/Bar.pm new file mode 100644 index 0000000..c4c6af8 --- /dev/null +++ b/t/lib/runtime/Foo/Bar.pm @@ -0,0 +1,7 @@ +package Foo::Bar; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Foo/Baz.pm b/t/lib/runtime/Foo/Baz.pm new file mode 100644 index 0000000..665f3b5 --- /dev/null +++ b/t/lib/runtime/Foo/Baz.pm @@ -0,0 +1,7 @@ +package Foo::Baz; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/lib/runtime/Foo/Conflicts.pm b/t/lib/runtime/Foo/Conflicts.pm new file mode 100644 index 0000000..34ea4b0 --- /dev/null +++ b/t/lib/runtime/Foo/Conflicts.pm @@ -0,0 +1,14 @@ +package Foo::Conflicts; +use strict; +use warnings; + +use Dist::CheckConflicts + ':runtime', + -conflicts => { + 'Foo::Foo' => 0.01, + 'Foo::Bar' => 0.01, + 'Foo::Baz' => 0.01, + 'Foo::Quux' => 0.01, + }; + +1; diff --git a/t/lib/runtime/Foo/Foo.pm b/t/lib/runtime/Foo/Foo.pm new file mode 100644 index 0000000..ca6c28e --- /dev/null +++ b/t/lib/runtime/Foo/Foo.pm @@ -0,0 +1,7 @@ +package Foo::Foo; +use strict; +use warnings; + +our $VERSION = 0.01; + +1; diff --git a/t/lib/runtime/Foo/Quux.pm b/t/lib/runtime/Foo/Quux.pm new file mode 100644 index 0000000..f813ae3 --- /dev/null +++ b/t/lib/runtime/Foo/Quux.pm @@ -0,0 +1,7 @@ +package Foo::Quux; +use strict; +use warnings; + +our $VERSION = 0.02; + +1; diff --git a/t/merge.t b/t/merge.t new file mode 100644 index 0000000..465fa50 --- /dev/null +++ b/t/merge.t @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use lib 't/lib/merge'; + +{ + use_ok('Foo::Conflicts'); + is_deeply( + { Foo::Conflicts->conflicts }, + { + 'Foo::One' => '0.03', + 'Foo::Two' => '0.03', + 'Foo::Three' => '0.02', + 'Foo::Four' => '0.02', + }, + "got the right conflicts" + ); +} + +done_testing; diff --git a/t/runtime.t b/t/runtime.t new file mode 100644 index 0000000..c1caae2 --- /dev/null +++ b/t/runtime.t @@ -0,0 +1,47 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use lib 't/lib/runtime'; + +sub use_ok_warnings { + my ($class, @conflicts) = @_; + local $Test::Builder::Level = $Test::Builder::Level + 1; + @conflicts = sort map { "Conflict detected for $_->[0]:\n $_->[1] is version $_->[2], but must be greater than version $_->[3]\n" } @conflicts; + + my @warnings; + { + local $SIG{__WARN__} = sub { push @warnings, $_[0] }; + use_ok($class); + } + @warnings = sort @warnings; + + is_deeply(\@warnings, \@conflicts, "correct runtime warnings for $class"); +} + +use_ok_warnings( + 'Foo', + ['Foo::Conflicts', 'Foo::Foo', '0.01', '0.01'], + ['Foo::Conflicts', 'Foo::Bar', '0.01', '0.01'], +); +use_ok_warnings( + 'Bar', + ['Bar::Conflicts', 'Bar::Baz::Bad', '0.01', '0.01'], + ['Bar::Conflicts', 'Bar::Foo::Bad', '0.01', '0.01'], + ['Bar::Conflicts', 'Bar::Foo', '0.01', '0.01'], + ['Bar::Conflicts', 'Bar::Bar::Bad', '0.01', '0.01'], + ['Bar::Conflicts', 'Bar::Bar', '0.01', '0.01'], + ['Bar::Conflicts', 'Bar::Quux::Bad', '0.01', '0.01'], +); + +is(Bar::Foo->contents, "__DATA__ for Bar::Foo\n", "__DATA__ sections intact"); +is(Bar::Bar->contents, "__DATA__ for Bar::Bar\n", "__DATA__ sections intact"); +is(Bar::Baz->contents, "__DATA__ for Bar::Baz\n", "__DATA__ sections intact"); +is(Bar::Quux->contents, "__DATA__ for Bar::Quux\n", "__DATA__ sections intact"); + +is(scalar(grep { ref($_) eq 'ARRAY' && @$_ > 1 && ref($_->[1]) eq 'HASH' } + @INC), + 1, + "only installed one \@INC hook"); + +done_testing; -- cgit v1.2.3