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); |
8 | use DBIC::SqlMakerTest; |
9 | |
10 | use_ok('DBICTest'); |
11 | |
12 | my $schema = DBICTest->init_schema(); |
13 | |
14 | my $sql_maker = $schema->storage->sql_maker; |
15 | |
16 | # a loop so that the callsite line does not change |
17 | for 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 | |
32 | done_testing; |