Try Schwern's latest Test::Builder offering on a stock perl and a threaded blead
[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);
8use DBIC::SqlMakerTest;
9
10use_ok('DBICTest');
11
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 {
20 my ($sql, @bind) = $sql_maker->select ('foo', undef, { -nest => \ 'bar' } );
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;