Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / prefetch / join_type.t
index 1698d6f..5165e09 100644 (file)
@@ -1,9 +1,11 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use warnings;
+use strict;
 
 use Test::More;
-use lib qw(t/lib);
-use DBIC::SqlMakerTest;
-use DBICTest;
+
+use DBICTest ':DiffSQL';
 
 my $schema = DBICTest->init_schema();
 
@@ -19,11 +21,16 @@ my $nulls = {
 
 # make sure null-prefetches do not screw with the final sql:
 for my $type (keys %$nulls) {
-#  is_same_sql_bind (
-#    $cds->search({}, { prefetch => { artist => $nulls->{$type} } })->as_query,
-#    $cds->as_query,
-#    "same sql with null $type prefetch"
-#  );
+  is_same_sql_bind (
+    $cds->search({}, { prefetch => { artist => $nulls->{$type} } })->as_query,
+    '( SELECT me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track,
+              artist.artistid, artist.name, artist.rank, artist.charfield
+        FROM cd me
+        JOIN artist artist
+          ON artist.artistid = me.artist
+    )', [],
+    "same sql with null $type prefetch"
+  );
 }
 
 # make sure left join is carried only starting from the first has_many