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