[Bast-commits] r6401 - DBIx-Class/0.08/trunk/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun May 24 13:35:07 GMT 2009


Author: ribasushi
Date: 2009-05-24 13:35:07 +0000 (Sun, 24 May 2009)
New Revision: 6401

Modified:
   DBIx-Class/0.08/trunk/t/42toplimit.t
Log:
Failing test about warnings triggered in SQLA::Limit when using a subquery

Modified: DBIx-Class/0.08/trunk/t/42toplimit.t
===================================================================
--- DBIx-Class/0.08/trunk/t/42toplimit.t	2009-05-24 13:07:45 UTC (rev 6400)
+++ DBIx-Class/0.08/trunk/t/42toplimit.t	2009-05-24 13:35:07 UTC (rev 6401)
@@ -7,7 +7,7 @@
 use DBICTest; # do not remove even though it is not used
 use DBIC::SqlMakerTest;
 
-plan tests => 8;
+plan tests => 10;
 
 my $sa = new DBIx::Class::SQLAHacks;
 $sa->limit_dialect( 'Top' );
@@ -43,3 +43,17 @@
       ],
       expected_sql_order => ['foo ASC, bar DESC, baz ASC, frew ASC', 'foo DESC, bar ASC, baz DESC, frew DESC']
   });
+
+{
+
+  my @w;
+  local $SIG{__WARN__} = sub { $_[0] =~ /Use of uninitialized value/ ? push @w, @_ : warn @_ };
+  my $subquery = $sa->select( [{ subq => \['(SELECT * FROM foo)'] }], [qw{bar baz}], undef, undef, 1, 3);
+  is_same_sql(
+    $subquery,
+    "SELECT * FROM ( SELECT TOP 1 * FROM ( SELECT TOP 4 bar,baz FROM (SELECT * FROM foo) ) AS foo) AS bar",
+  );
+
+  is (@w, 0, 'No warnings on limit with subquery')
+    || diag join ("\n", @w);
+}




More information about the Bast-commits mailing list