From: Graham Knop Date: Tue, 19 Apr 2016 12:16:17 +0000 (-0400) Subject: whitespace cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a9bebe0a7eabd7b70673ff725f36caa82107bcc;p=gitmo%2FClass-C3-XS.git whitespace cleanup --- diff --git a/t/01_MRO.t b/t/01_MRO.t index 6206e76..d988639 100644 --- a/t/01_MRO.t +++ b/t/01_MRO.t @@ -29,7 +29,7 @@ This tests the classic diamond inheritence pattern. } { package Diamond_C; - use base 'Diamond_A'; + use base 'Diamond_A'; } { package Diamond_D; diff --git a/t/02_MRO.t b/t/02_MRO.t index 39adb84..70104eb 100644 --- a/t/02_MRO.t +++ b/t/02_MRO.t @@ -48,23 +48,23 @@ Level 0 0 | A | (more specialized) { package Test::O; our @ISA = qw//; - - package Test::F; - use base 'Test::O'; - + + package Test::F; + use base 'Test::O'; + package Test::E; - use base 'Test::O'; - + use base 'Test::O'; + package Test::D; - use base 'Test::O'; - + use base 'Test::O'; + package Test::C; use base ('Test::D', 'Test::F'); - - package Test::B; - use base ('Test::D', 'Test::E'); - - package Test::A; + + package Test::B; + use base ('Test::D', 'Test::E'); + + package Test::A; use base ('Test::B', 'Test::C'); } @@ -76,25 +76,24 @@ is_deeply( is_deeply( [ Class::C3::XS::calculateMRO('Test::E') ], [ qw(Test::E Test::O) ], - '... got the right MRO for Test::E'); + '... got the right MRO for Test::E'); is_deeply( [ Class::C3::XS::calculateMRO('Test::D') ], [ qw(Test::D Test::O) ], - '... got the right MRO for Test::D'); + '... got the right MRO for Test::D'); is_deeply( [ Class::C3::XS::calculateMRO('Test::C') ], [ qw(Test::C Test::D Test::F Test::O) ], - '... got the right MRO for Test::C'); + '... got the right MRO for Test::C'); is_deeply( [ Class::C3::XS::calculateMRO('Test::B') ], [ qw(Test::B Test::D Test::E Test::O) ], - '... got the right MRO for Test::B'); + '... got the right MRO for Test::B'); is_deeply( [ Class::C3::XS::calculateMRO('Test::A') ], [ qw(Test::A Test::B Test::C Test::D Test::E Test::F Test::O) ], - '... got the right MRO for Test::A'); - + '... got the right MRO for Test::A'); diff --git a/t/03_MRO.t b/t/03_MRO.t index b4cbeab..1ddabc0 100644 --- a/t/03_MRO.t +++ b/t/03_MRO.t @@ -53,22 +53,22 @@ Level 0 0 | A | { package Test::O; our @ISA = qw//; - + package Test::F; use base 'Test::O'; - + package Test::E; use base 'Test::O'; - + package Test::D; - use base 'Test::O'; - + use base 'Test::O'; + package Test::C; use base ('Test::D', 'Test::F'); package Test::B; use base ('Test::E', 'Test::D'); - + package Test::A; use base ('Test::B', 'Test::C'); } @@ -76,4 +76,4 @@ Level 0 0 | A | is_deeply( [ Class::C3::XS::calculateMRO('Test::A') ], [ qw(Test::A Test::B Test::E Test::C Test::D Test::F Test::O) ], - '... got the right MRO for Test::A'); + '... got the right MRO for Test::A'); diff --git a/t/04_MRO.t b/t/04_MRO.t index 360840a..8562559 100644 --- a/t/04_MRO.t +++ b/t/04_MRO.t @@ -14,7 +14,7 @@ example taken from: L Object ^ | - LifeForm + LifeForm ^ ^ / \ Sentient BiPedal @@ -34,24 +34,24 @@ example taken from: L =cut { - package Object; + package Object; our @ISA = qw//; - + package LifeForm; use base 'Object'; - + package Sentient; use base 'LifeForm'; - + package BiPedal; use base 'LifeForm'; - + package Intelligent; use base 'Sentient'; - + package Humanoid; use base 'BiPedal'; - + package Vulcan; use base ('Intelligent', 'Humanoid'); } @@ -59,4 +59,4 @@ example taken from: L is_deeply( [ Class::C3::XS::calculateMRO('Vulcan') ], [ qw(Vulcan Intelligent Sentient Humanoid BiPedal LifeForm Object) ], - '... got the right MRO for the Vulcan Dylan Example'); + '... got the right MRO for the Vulcan Dylan Example'); diff --git a/t/30_next_method.t b/t/30_next_method.t index 911b58c..dfd2b9b 100644 --- a/t/30_next_method.t +++ b/t/30_next_method.t @@ -22,37 +22,37 @@ This tests the classic diamond inheritence pattern. { package Diamond_A; sub hello { 'Diamond_A::hello' } - sub foo { 'Diamond_A::foo' } + sub foo { 'Diamond_A::foo' } } { package Diamond_B; use base 'Diamond_A'; - sub foo { 'Diamond_B::foo => ' . (shift)->next::method() } + sub foo { 'Diamond_B::foo => ' . (shift)->next::method() } } { package Diamond_C; - use base 'Diamond_A'; + use base 'Diamond_A'; sub hello { 'Diamond_C::hello => ' . (shift)->next::method() } - sub foo { 'Diamond_C::foo => ' . (shift)->next::method() } + sub foo { 'Diamond_C::foo => ' . (shift)->next::method() } } { package Diamond_D; use base ('Diamond_B', 'Diamond_C'); - - sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } + + sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } } is(Diamond_C->hello, 'Diamond_C::hello => Diamond_A::hello', '... method resolved itself as expected'); -is(Diamond_C->can('hello')->('Diamond_C'), - 'Diamond_C::hello => Diamond_A::hello', +is(Diamond_C->can('hello')->('Diamond_C'), + 'Diamond_C::hello => Diamond_A::hello', '... can(method) resolved itself as expected'); - -is(UNIVERSAL::can("Diamond_C", 'hello')->('Diamond_C'), - 'Diamond_C::hello => Diamond_A::hello', + +is(UNIVERSAL::can("Diamond_C", 'hello')->('Diamond_C'), + 'Diamond_C::hello => Diamond_A::hello', '... can(method) resolved itself as expected'); -is(Diamond_D->foo, - 'Diamond_D::foo => Diamond_B::foo => Diamond_C::foo => Diamond_A::foo', +is(Diamond_D->foo, + 'Diamond_D::foo => Diamond_B::foo => Diamond_C::foo => Diamond_A::foo', '... method foo resolved itself as expected'); diff --git a/t/31_next_method_skip.t b/t/31_next_method_skip.t index 710c073..f5c74ae 100644 --- a/t/31_next_method_skip.t +++ b/t/31_next_method_skip.t @@ -21,36 +21,36 @@ This tests the classic diamond inheritence pattern. { package Diamond_A; - sub bar { 'Diamond_A::bar' } + sub bar { 'Diamond_A::bar' } sub baz { 'Diamond_A::baz' } } { package Diamond_B; use base 'Diamond_A'; - sub baz { 'Diamond_B::baz => ' . (shift)->next::method() } + sub baz { 'Diamond_B::baz => ' . (shift)->next::method() } } { package Diamond_C; - use base 'Diamond_A'; - sub foo { 'Diamond_C::foo' } - sub buz { 'Diamond_C::buz' } - + use base 'Diamond_A'; + sub foo { 'Diamond_C::foo' } + sub buz { 'Diamond_C::buz' } + sub woz { 'Diamond_C::woz' } - sub maybe { 'Diamond_C::maybe' } + sub maybe { 'Diamond_C::maybe' } } { package Diamond_D; use base ('Diamond_B', 'Diamond_C'); - sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } - sub bar { 'Diamond_D::bar => ' . (shift)->next::method() } - sub buz { 'Diamond_D::buz => ' . (shift)->baz() } - sub fuz { 'Diamond_D::fuz => ' . (shift)->next::method() } - + sub foo { 'Diamond_D::foo => ' . (shift)->next::method() } + sub bar { 'Diamond_D::bar => ' . (shift)->next::method() } + sub buz { 'Diamond_D::buz => ' . (shift)->baz() } + sub fuz { 'Diamond_D::fuz => ' . (shift)->next::method() } + sub woz { 'Diamond_D::woz can => ' . ((shift)->next::can() ? 1 : 0) } sub noz { 'Diamond_D::noz can => ' . ((shift)->next::can() ? 1 : 0) } sub maybe { 'Diamond_D::maybe => ' . ((shift)->maybe::next::method() || 0) } - sub moybe { 'Diamond_D::moybe => ' . ((shift)->maybe::next::method() || 0) } + sub moybe { 'Diamond_D::moybe => ' . ((shift)->maybe::next::method() || 0) } } diff --git a/t/32_next_method_edge_cases.t b/t/32_next_method_edge_cases.t index 6c32894..d04f311 100644 --- a/t/32_next_method_edge_cases.t +++ b/t/32_next_method_edge_cases.t @@ -23,7 +23,7 @@ use Class::C3::XS; isa_ok($foo, 'Foo'); can_ok($foo, 'bar'); - is($foo->bar(), 'Foo::bar', '... got the right return value'); + is($foo->bar(), 'Foo::bar', '... got the right return value'); # fail calling it from a subclass @@ -32,17 +32,17 @@ use Class::C3::XS; use strict; use warnings; our @ISA = ('Foo'); - } - + } + my $bar = Bar->new(); isa_ok($bar, 'Bar'); - isa_ok($bar, 'Foo'); - + isa_ok($bar, 'Foo'); + # test it working with with Sub::Name - SKIP: { + SKIP: { eval 'use Sub::Name'; skip "Sub::Name is required for this test", 3 if $@; - + my $m = sub { (shift)->next::method() }; Sub::Name::subname('Bar::bar', $m); { @@ -55,19 +55,19 @@ use Class::C3::XS; ok(!$@, '... calling bar() succedded') || diag $@; is($value, 'Foo::bar', '... got the right return value too'); } - + # test it failing without Sub::Name { package Baz; use strict; use warnings; our @ISA = ('Foo'); - } - + } + my $baz = Baz->new(); isa_ok($baz, 'Baz'); - isa_ok($baz, 'Foo'); - + isa_ok($baz, 'Foo'); + { my $m = sub { (shift)->next::method() }; { @@ -77,5 +77,5 @@ use Class::C3::XS; eval { $baz->bar() }; ok($@, '... calling bar() with next::method failed') || diag $@; - } + } } diff --git a/t/33_next_method_used_with_NEXT.t b/t/33_next_method_used_with_NEXT.t index 42a3b61..c3aef21 100644 --- a/t/33_next_method_used_with_NEXT.t +++ b/t/33_next_method_used_with_NEXT.t @@ -17,31 +17,31 @@ use Class::C3::XS; package Foo; use strict; use warnings; - + sub foo { 'Foo::foo' } - + package Fuz; use strict; use warnings; use base 'Foo'; sub foo { 'Fuz::foo => ' . (shift)->next::method } - + package Bar; use strict; - use warnings; + use warnings; use base 'Foo'; sub foo { 'Bar::foo => ' . (shift)->next::method } - + package Baz; use strict; - use warnings; + use warnings; require NEXT; # load this as late as possible so we can catch the test skip use base 'Bar', 'Fuz'; - - sub foo { 'Baz::foo => ' . (shift)->NEXT::foo } + + sub foo { 'Baz::foo => ' . (shift)->NEXT::foo } } is(Foo->foo, 'Foo::foo', '... got the right value from Foo->foo'); diff --git a/t/34_next_method_in_eval.t b/t/34_next_method_in_eval.t index a5ef30c..f674f95 100644 --- a/t/34_next_method_in_eval.t +++ b/t/34_next_method_in_eval.t @@ -25,7 +25,7 @@ This tests the use of an eval{} block to wrap a next::method call. { package B; use base 'A'; - + sub foo { eval { return 'B::foo => ' . (shift)->next::method(); @@ -37,8 +37,8 @@ This tests the use of an eval{} block to wrap a next::method call. } } -like(B->foo, - qr/^A::foo died/, +like(B->foo, + qr/^A::foo died/, 'method resolved inside eval{}'); diff --git a/t/35_next_method_in_anon.t b/t/35_next_method_in_anon.t index b3b583b..bf96596 100644 --- a/t/35_next_method_in_anon.t +++ b/t/35_next_method_in_anon.t @@ -29,7 +29,7 @@ anonymous subroutine. { package B; use base 'A'; - + sub foo { my $code = sub { return 'B::foo => ' . (shift)->next::method();