Tighten up select list processing in ::SQLMaker
[dbsrgits/DBIx-Class.git] / t / sqlmaker / nest_deprec.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
b1d821de 3use strict;
4use warnings;
5
6use Test::More;
7use Test::Warn;
8
c0329273 9
a5a7bb73 10use DBICTest ':DiffSQL';
b1d821de 11
b1d821de 12my $schema = DBICTest->init_schema();
13
14my $sql_maker = $schema->storage->sql_maker;
15
16# a loop so that the callsite line does not change
17for my $expect_warn (1, 0) {
18 warnings_like (
19 sub {
02562a20 20 my ($sql, @bind) = $sql_maker->select ('foo', '*', { -nest => \ 'bar' } );
b1d821de 21 is_same_sql_bind (
22 $sql, \@bind,
23 'SELECT * FROM foo WHERE ( bar )', [],
24 '-nest still works'
25 );
26 },
27 ($expect_warn ? qr/\Q-nest in search conditions is deprecated/ : []),
28 'Only one deprecation warning'
29 );
30}
31
32done_testing;