Fix incorrect whitespace test outside of checkouts
[dbsrgits/DBIx-Class.git] / t / search / empty_attrs.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7
8
9 use DBICTest ':DiffSQL';
10
11 my $schema = DBICTest->init_schema();
12
13 my $rs = $schema->resultset('Artist')->search(
14   [ -and => [ {}, [] ], -or => [ {}, [] ] ],
15   {
16     select => [],
17     columns => {},
18     '+columns' => 'artistid',
19     join => [ {}, [ [ {}, {} ] ], {} ],
20     prefetch => [ [ [ {}, [] ], {} ], {}, [ {} ] ],
21     order_by => [],
22     group_by => [],
23     offset => 0,
24   }
25 );
26
27 is_same_sql_bind(
28   $rs->as_query,
29   '(SELECT me.artistid FROM artist me)',
30   [],
31 );
32
33 is_same_sql_bind(
34   $rs->count_rs->as_query,
35   '(SELECT COUNT(*) FROM artist me)',
36   [],
37 );
38
39 is_same_sql_bind(
40   $rs->as_subselect_rs->search({}, { columns => 'artistid' })->as_query,
41   '(SELECT me.artistid FROM (SELECT me.artistid FROM artist me) me)',
42   [],
43 );
44
45 {
46   local $TODO = 'Stupid misdesigned as_subselect_rs';
47   is_same_sql_bind(
48     $rs->as_subselect_rs->as_query,
49     $rs->as_subselect_rs->search({}, { columns => 'artistid' })->as_query,
50   );
51 }
52
53 done_testing;