X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frow%2Ffilter_column.t;h=af7a951f2b3e3ddb40b56edce7dd9fde993a6b45;hb=c0329273268971824784f239f32c7246e68da9c5;hp=10ac1a4d79bbcc4a22f1d0d61e75da6a3642e04d;hpb=7ed4b48f691b78a3d832266d3a253a4d5c6a4837;p=dbsrgits%2FDBIx-Class.git diff --git a/t/row/filter_column.t b/t/row/filter_column.t index 10ac1a4..af7a951 100644 --- a/t/row/filter_column.t +++ b/t/row/filter_column.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $from_storage_ran = 0; @@ -260,6 +262,18 @@ throws_ok { DBICTest::Schema::Artist->filter_column( charfield => {} ) } ; FC_ON_PK_TEST: { + # there are cases in the wild that autovivify stuff deep in the + # colinfo guts. While this is insane, there is no alternative + # so at leats make sure it keeps working... + + $schema->source('Artist')->column_info('artistid')->{_filter_info} ||= {}; + + for my $key ('', 'primary') { + lives_ok { + $schema->resultset('Artist')->find_or_create({ artistid => 42 }, { $key ? ( key => $key ) : () }); + }; + } + DBICTest::Schema::Artist->filter_column(artistid => { filter_to_storage => sub { $_[1] * 100 },