X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F93autocast.t;h=4d9eee0589ec6577b6a4895339a0a31c2d2dbe79;hb=835cdc8d730b128213ab8b10f6cf81326ebfc0e8;hp=a8375be87fb791780dc8b7828f5d975d777be748;hpb=ce012195f14f1e186f8c91cd0cbc2a11bc9088d7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/93autocast.t b/t/93autocast.t index a8375be..4d9eee0 100644 --- a/t/93autocast.t +++ b/t/93autocast.t @@ -20,7 +20,7 @@ use DBIC::SqlMakerTest; int => undef, # no conversion }; - sub _map_data_type { + sub _native_data_type { return $type_map->{$_[1]}; } } @@ -33,9 +33,15 @@ my $rs = $schema->resultset ('CD')->search ({ 'tracks.last_updated_at' => { '!=', undef }, 'tracks.last_updated_on' => { '<', 2009 }, 'tracks.position' => 4, + 'tracks.single_track' => \[ '= ?', [ single_track => [1, 2, 3 ] ] ], }, { join => 'tracks' }); -my $bind = [ [ cdid => 5 ], [ 'tracks.last_updated_on' => 2009 ], [ 'tracks.position' => 4 ] ]; +my $bind = [ + [ cdid => 5 ], + [ 'tracks.last_updated_on' => 2009 ], + [ 'tracks.position' => 4 ], + [ 'single_track' => [ 1, 2, 3] ], +]; is_same_sql_bind ( $rs->as_query, @@ -48,6 +54,7 @@ is_same_sql_bind ( AND tracks.last_updated_at IS NOT NULL AND tracks.last_updated_on < ? AND tracks.position = ? + AND tracks.single_track = ? )', $bind, 'expected sql with casting off', @@ -66,6 +73,7 @@ is_same_sql_bind ( AND tracks.last_updated_at IS NOT NULL AND tracks.last_updated_on < CAST (? AS yyy) AND tracks.position = ? + AND tracks.single_track = CAST(? AS INT) )', $bind, 'expected sql with casting on',