X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=t%2Fsqlmaker%2Fcore_quoted.t;h=86820931debcdd14c678ca27109a53d2e962df15;hp=d483a4033e2c30286030385312472fb8d09c495f;hb=02562a2092543488bba4ccd98c39abca72560555;hpb=8aae794001ecccdb26c2bbd1b92c97bba9e65d79 diff --git a/t/sqlmaker/core_quoted.t b/t/sqlmaker/core_quoted.t index d483a40..8682093 100644 --- a/t/sqlmaker/core_quoted.t +++ b/t/sqlmaker/core_quoted.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; - +use Test::Warn; use DBICTest ':DiffSQL'; @@ -354,4 +354,15 @@ is_same_sql_bind( 'bracket quoted table names for UPDATE' ); + +# Warning and sane behavior on ... select => [] ... +warnings_exist { + local $TODO = "Some day we need to stop issuing implicit SELECT *"; + is_same_sql_bind( + $schema->resultset("Artist")->search({}, { columns => [] })->as_query, + '( SELECT 42 FROM [artist] [me] )', + [], + ); +} qr/\QResultSets with an empty selection are deprecated (you almost certainly did not mean to do that): if this is indeed your intent you must explicitly supply/; + done_testing;