Commit | Line | Data |
b1d821de |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | use Test::Warn; |
6 | |
d7571c64 |
7 | local $TODO = 'Temporarily todo-ed for dq2eb'; |
8 | |
b1d821de |
9 | use lib qw(t/lib); |
5e724964 |
10 | use DBICTest; |
b1d821de |
11 | use DBIC::SqlMakerTest; |
12 | |
b1d821de |
13 | my $schema = DBICTest->init_schema(); |
14 | |
15 | my $sql_maker = $schema->storage->sql_maker; |
16 | |
17 | # a loop so that the callsite line does not change |
18 | for my $expect_warn (1, 0) { |
19 | warnings_like ( |
20 | sub { |
21 | my ($sql, @bind) = $sql_maker->select ('foo', undef, { -nest => \ 'bar' } ); |
22 | is_same_sql_bind ( |
23 | $sql, \@bind, |
24 | 'SELECT * FROM foo WHERE ( bar )', [], |
25 | '-nest still works' |
26 | ); |
27 | }, |
28 | ($expect_warn ? qr/\Q-nest in search conditions is deprecated/ : []), |
29 | 'Only one deprecation warning' |
30 | ); |
31 | } |
32 | |
33 | done_testing; |