Commit | Line | Data |
b1d821de |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | use Test::Warn; |
6 | |
7 | use lib qw(t/lib); |
a5a7bb73 |
8 | use DBICTest ':DiffSQL'; |
b1d821de |
9 | |
b1d821de |
10 | my $schema = DBICTest->init_schema(); |
11 | |
12 | my $sql_maker = $schema->storage->sql_maker; |
13 | |
14 | # a loop so that the callsite line does not change |
15 | for 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 | |
30 | done_testing; |