[Bast-commits] r5065 - in SQL-Abstract/1.x/branches/1.50_RC: lib/SQL/Abstract t

dami at dev.catalyst.perl.org dami at dev.catalyst.perl.org
Thu Nov 6 15:19:35 GMT 2008


Author: dami
Date: 2008-11-06 15:19:34 +0000 (Thu, 06 Nov 2008)
New Revision: 5065

Modified:
   SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm
   SQL-Abstract/1.x/branches/1.50_RC/t/00new.t
   SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
   SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
   SQL-Abstract/1.x/branches/1.50_RC/t/03values.t
   SQL-Abstract/1.x/branches/1.50_RC/t/06order_by.t
   SQL-Abstract/1.x/branches/1.50_RC/t/07subqueries.t
   SQL-Abstract/1.x/branches/1.50_RC/t/08special_ops.t
Log:
patch from mendel, using Test::Builder

Modified: SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/lib/SQL/Abstract/Test.pm	2008-11-06 15:19:34 UTC (rev 5065)
@@ -2,8 +2,7 @@
 
 use strict;
 use warnings;
-use Test::More;
-use base 'Exporter';
+use base qw/Test::Builder::Module Exporter/;
 use Data::Dumper;
 use Carp;
 
@@ -12,6 +11,7 @@
 
 our $case_sensitive = 0;
 our $sql_differ; # keeps track of differing portion between SQLs
+our $tb = __PACKAGE__->builder;
 
 sub is_same_sql_bind {
   my ($sql1, $bind_ref1, $sql2, $bind_ref2, $msg) = @_;
@@ -23,21 +23,21 @@
   my $same_bind = eq_bind($bind_ref1, $bind_ref2);
 
   # call Test::More::ok
-  ok($same_sql && $same_bind, $msg);
+  $tb->ok($same_sql && $same_bind, $msg);
 
   # add debugging info
   if (!$same_sql) {
-    diag "SQL expressions differ\n"
+    $tb->diag("SQL expressions differ\n"
         ."     got: $sql1\n"
         ."expected: $sql2\n"
-        ."differing in :\n$sql_differ\n";
-        ;
+        ."differing in :\n$sql_differ\n"
+        );
   }
   if (!$same_bind) {
-    diag "BIND values differ\n"
+    $tb->diag("BIND values differ\n"
         ."     got: " . Dumper($bind_ref1)
         ."expected: " . Dumper($bind_ref2)
-        ;
+        );
   }
 }
 
@@ -160,7 +160,7 @@
 
   use SQL::Abstract;
   use Test::More;
-  use SQL::Abstract::Test qw/is_same_sql_bind/;
+  use SQL::Abstract::Test import => ['is_same_sql_bind'];
   
   my ($sql, @bind) = SQL::Abstract->new->select(%args);
   is_same_sql_bind($given_sql,    \@given_bind, 

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/00new.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/00new.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/00new.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 
 plan tests => 15;
 

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/01generate.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 plan tests => 64;
 
 use SQL::Abstract;

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/02where.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/02where.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/02where.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 use Test::Exception;
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 
 plan tests => 17;
 

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/03values.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/03values.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/03values.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 plan tests => 5;
 
 use SQL::Abstract;

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/06order_by.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/06order_by.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/06order_by.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -6,7 +6,7 @@
 
 use SQL::Abstract;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 my @cases = 
   (
    {

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/07subqueries.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/07subqueries.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/07subqueries.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 plan tests => 5;
 
 use SQL::Abstract;

Modified: SQL-Abstract/1.x/branches/1.50_RC/t/08special_ops.t
===================================================================
--- SQL-Abstract/1.x/branches/1.50_RC/t/08special_ops.t	2008-11-06 12:44:36 UTC (rev 5064)
+++ SQL-Abstract/1.x/branches/1.50_RC/t/08special_ops.t	2008-11-06 15:19:34 UTC (rev 5065)
@@ -4,7 +4,7 @@
 use warnings;
 use Test::More;
 
-use SQL::Abstract::Test qw/is_same_sql_bind/;
+use SQL::Abstract::Test import => ['is_same_sql_bind'];
 plan tests => 2;
 
 use SQL::Abstract;




More information about the Bast-commits mailing list