--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use Test::Warn;
+use lib qw(t/lib);
+use DBICTest::Schema::Artist;
+use Data::Query::ExprDeclare;
+BEGIN {
+ DBICTest::Schema::Artist->has_many(
+ cds2 => 'DBICTest::Schema::CD',
+ expr { $_->foreign->artist == $_->self->artistid }
+ );
+ DBICTest::Schema::Artist->has_many(
+ cds2_pre2k => 'DBICTest::Schema::CD',
+ expr {
+ $_->foreign->artist == $_->self->artistid
+ & $_->foreign->year < 2000
+ }
+ );
+}
+use DBICTest;
+use DBIC::SqlMakerTest;
+
+my $schema = DBICTest->init_schema();
+
+my $mccrae = $schema->resultset('Artist')
+ ->find({ name => 'Caterwauler McCrae' });
+
+is($mccrae->cds2->count, 3, 'CDs returned from expr join');
+
+is($mccrae->cds2_pre2k->count, 2, 'CDs returned from expr w/cond');
+
+done_testing;
+++ /dev/null
-use strict;
-use warnings;
-
-use Test::More;
-use Test::Exception;
-use Test::Warn;
-use lib qw(t/lib);
-use DBICTest::Schema::Artist;
-use Data::Query::ExprDeclare;
-BEGIN {
- DBICTest::Schema::Artist->has_many(
- cds2 => 'DBICTest::Schema::CD',
- expr { $_->foreign->artist == $_->self->artistid }
- );
- DBICTest::Schema::Artist->has_many(
- cds2_pre2k => 'DBICTest::Schema::CD',
- expr {
- $_->foreign->artist == $_->self->artistid
- & $_->foreign->year < 2000
- }
- );
-}
-use DBICTest;
-use DBIC::SqlMakerTest;
-
-my $schema = DBICTest->init_schema();
-
-my $mccrae = $schema->resultset('Artist')
- ->find({ name => 'Caterwauler McCrae' });
-
-is($mccrae->cds2->count, 3, 'CDs returned from expr join');
-
-is($mccrae->cds2_pre2k->count, 2, 'CDs returned from expr w/cond');
-
-$schema->source($_)->resultset_class('DBIx::Class::ResultSet::WithDQMethods')
- for qw(CD Tag);
-
-my $cds = $schema->resultset('CD')
- ->where(expr { $_->artist->name eq 'Caterwauler McCrae' });
-
-is($cds->count, 3, 'CDs via join injection');
-
-my $tags = $schema->resultset('Tag')
- ->where(expr { $_->cd->artist->name eq 'Caterwauler McCrae' });
-
-is($tags->count, 5, 'Tags via two step join injection');
-
-done_testing;
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use Test::Warn;
+use lib qw(t/lib);
+use DBICTest;
+use DBIC::SqlMakerTest;
+use Data::Query::ExprDeclare;
+
+my $schema = DBICTest->init_schema();
+
+my $mccrae = $schema->resultset('Artist')
+ ->find({ name => 'Caterwauler McCrae' });
+
+my @cds = $schema->resultset('CD')
+ ->search(expr { $_->artist == $mccrae->artistid });
+
+is(@cds, 3, 'CDs returned from expr search by artistid');
+
+my @years = $schema->resultset('CD')
+ ->search(expr { $_->year < 2000 })
+ ->get_column('year')
+ ->all;
+
+is_deeply([ sort @years ], [ 1997, 1998, 1999 ], 'Years for < search');
+
+my $tag_cond = expr { $_->tag eq 'Blue' };
+
+is($schema->resultset('Tag')->search($tag_cond)->count, 4, 'Simple tag cond');
+
+$tag_cond &= expr { $_->cd < 4 };
+
+is($schema->resultset('Tag')->search($tag_cond)->count, 3, 'Combi tag cond');
+
+done_testing;
use Test::Exception;
use Test::Warn;
use lib qw(t/lib);
+use Data::Query::ExprDeclare;
use DBICTest;
use DBIC::SqlMakerTest;
-use Data::Query::ExprDeclare;
my $schema = DBICTest->init_schema();
-my $mccrae = $schema->resultset('Artist')
- ->find({ name => 'Caterwauler McCrae' });
-
-my @cds = $schema->resultset('CD')
- ->search(expr { $_->artist == $mccrae->artistid });
-
-is(@cds, 3, 'CDs returned from expr search by artistid');
-
-my @years = $schema->resultset('CD')
- ->search(expr { $_->year < 2000 })
- ->get_column('year')
- ->all;
-
-is_deeply([ sort @years ], [ 1997, 1998, 1999 ], 'Years for < search');
+$schema->source($_)->resultset_class('DBIx::Class::ResultSet::WithDQMethods')
+ for qw(CD Tag);
-my $tag_cond = expr { $_->tag eq 'Blue' };
+my $cds = $schema->resultset('CD')
+ ->where(expr { $_->artist->name eq 'Caterwauler McCrae' });
-is($schema->resultset('Tag')->search($tag_cond)->count, 4, 'Simple tag cond');
+is($cds->count, 3, 'CDs via join injection');
-$tag_cond &= expr { $_->cd < 4 };
+my $tags = $schema->resultset('Tag')
+ ->where(expr { $_->cd->artist->name eq 'Caterwauler McCrae' });
-is($schema->resultset('Tag')->search($tag_cond)->count, 3, 'Combi tag cond');
+is($tags->count, 5, 'Tags via two step join injection');
done_testing;