X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F85utf8.t;fp=t%2F85utf8.t;h=5ea1a607d3caab4121dae62956357301f8200a6d;hb=72ae8e408a95ca2a9165a2dc1ae7952b5f51463f;hp=9f1ab0f8ce917ec912595b7c04464e2add10f954;hpb=8384a713d9046e08314e06bf17c2a878cd215819;p=dbsrgits%2FDBIx-Class.git diff --git a/t/85utf8.t b/t/85utf8.t index 9f1ab0f..5ea1a60 100644 --- a/t/85utf8.t +++ b/t/85utf8.t @@ -6,22 +6,52 @@ use Test::Warn; use lib qw(t/lib); use DBICTest; -warning_like ( - sub { - package A::Comp; - use base 'DBIx::Class'; - sub store_column { shift->next::method (@_) }; - 1; +{ + package A::Comp; + use base 'DBIx::Class'; + sub store_column { shift->next::method (@_) }; + 1; +} + +{ + package A::SubComp; + use base 'A::Comp'; + 1; +} +warnings_like ( + sub { package A::Test; use base 'DBIx::Class::Core'; - __PACKAGE__->load_components(qw(UTF8Columns +A::Comp)); + __PACKAGE__->load_components(qw(UTF8Columns +A::SubComp +A::Comp)); 1; }, - qr/Incorrect loading order of DBIx::Class::UTF8Columns.+affect other components overriding store_column \(A::Comp\)/, + [qr/Incorrect loading order of DBIx::Class::UTF8Columns.+affect other components overriding store_column \(A::Comp\)/], 'incorrect order warning issued', ); +warnings_are ( + sub { + package A::Test2; + use base 'DBIx::Class::Core'; + __PACKAGE__->load_components(qw(Core +A::Comp Ordered UTF8Columns)); + __PACKAGE__->load_components(qw(Ordered +A::Comp Row UTF8Columns Core)); + 1; + }, + [], + 'no spurious warnings issued', +); + +my $test2_mro; +my $idx = 0; +for (@{mro::get_linear_isa ('A::Test2')} ) { + $test2_mro->{$_} = $idx++; +} + +cmp_ok ($test2_mro->{'A::Comp'}, '<', $test2_mro->{'DBIx::Class::UTF8Columns'}, 'mro of Test2 correct (A::Comp before UTF8Col)' ); +cmp_ok ($test2_mro->{'DBIx::Class::UTF8Columns'}, '<', $test2_mro->{'DBIx::Class::Core'}, 'mro of Test2 correct (UTF8Col before Core)' ); +cmp_ok ($test2_mro->{'DBIx::Class::Core'}, '<', $test2_mro->{'DBIx::Class::Row'}, 'mro of Test2 correct (Core before Row)' ); + my $schema = DBICTest->init_schema(); DBICTest::Schema::CD->load_components('UTF8Columns'); DBICTest::Schema::CD->utf8_columns('title');