X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi-t%2F02-Film.t;fp=t%2Fcdbi-t%2F02-Film.t;h=ee28a68dd734ab605c65ef799643a5efc3636236;hb=28f7f7d31e0d17c5362935ac52f7e67a189ddf0f;hp=57ad4116f8f069ffbfc2e80edca771f2daff9b11;hpb=c79bd6e9b40607d08e41879ecad0804c38bf14dc;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi-t/02-Film.t b/t/cdbi-t/02-Film.t index 57ad411..ee28a68 100644 --- a/t/cdbi-t/02-Film.t +++ b/t/cdbi-t/02-Film.t @@ -9,7 +9,7 @@ BEGIN { next; } eval "use DBD::SQLite"; - plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 96); + plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 98); } INIT { @@ -126,6 +126,11 @@ is($blrunner_dc->NumExplodingSheep, undef, 'Sheep correct'); { Film->add_constructor(title_asc => "title LIKE ? ORDER BY title"); Film->add_constructor(title_desc => "title LIKE ? ORDER BY title DESC"); + Film->add_constructor(title_asc_nl => q{ + title LIKE ? + ORDER BY title + LIMIT 1 + }); { my @films = Film->title_asc("Bladerunner%"); @@ -137,6 +142,11 @@ is($blrunner_dc->NumExplodingSheep, undef, 'Sheep correct'); is @films, 2, "We have 2 Bladerunners"; is $films[0]->Title, $blrunner_dc->Title, "Ordered correctly"; } + { + my @films = Film->title_asc_nl("Bladerunner%"); + is @films, 1, "We have 2 Bladerunners"; + is $films[0]->Title, $blrunner->Title, "Ordered correctly"; + } } # Multi-column search