From: Michael G Schwern Date: Tue, 12 Feb 2008 01:21:42 +0000 (-0800) Subject: Test "like" in search_where() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d37c21dc1dff22a2c154aa74a46c8f3076df994c;p=dbsrgits%2FDBIx-Class-Historic.git Test "like" in search_where() --- diff --git a/t/cdbi-abstract/search_where.t b/t/cdbi-abstract/search_where.t index 3161299..3a89e3c 100644 --- a/t/cdbi-abstract/search_where.t +++ b/t/cdbi-abstract/search_where.t @@ -12,7 +12,7 @@ BEGIN { next; } eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 9); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 10); } INIT { @@ -28,6 +28,13 @@ my $superman = Film->search_where( Title => "Superman" ); is $superman->next->Title, "Superman", "search_where() as iterator"; is $superman->next, undef; +{ + my @supers = Film->search_where({ title => { 'like' => 'Super%' } }); + is_deeply [sort map $_->Title, @supers], + [sort ("Super Fuzz", "Superman")], 'like'; +} + + my @all = Film->search_where({}, { order_by => "Title ASC" }); is_deeply ["Batman", "Super Fuzz", "Superman"], [map $_->Title, @all],