rename -tuple to -row
[dbsrgits/SQL-Abstract.git] / lib / SQL / Abstract / Test.pm
index 8aa6f3e..fece0e0 100644 (file)
@@ -2,7 +2,7 @@ package SQL::Abstract::Test; # see doc at end of file
 
 use strict;
 use warnings;
-use base qw(Test::Builder::Module Exporter);
+use base qw(Test::Builder::Module);
 use Test::Builder;
 use Test::Deep ();
 use SQL::Abstract::Tree;
@@ -124,6 +124,12 @@ sub _sql_differ_diag {
   my $sql2 = shift || '';
 
   my $tb = $tb || __PACKAGE__->builder;
+
+  if (my $profile = $ENV{SQL_ABSTRACT_TEST_TREE_PROFILE}) {
+    my $sqlat = SQL::Abstract::Tree->new(profile => $profile);
+    $_ = $sqlat->format($_) for ($sql1, $sql2);
+  }
+
   $tb->${\($tb->in_todo ? 'note' : 'diag')} (
        "SQL expressions differ\n"
       ." got: $sql1\n"
@@ -135,7 +141,7 @@ sub _sql_differ_diag {
 sub _bind_differ_diag {
   my ($bind_ref1, $bind_ref2) = @_;
 
-  my $tb = __PACKAGE__->builder;
+  my $tb = $tb || __PACKAGE__->builder;
   $tb->${\($tb->in_todo ? 'note' : 'diag')} (
     "BIND values differ " . dumper({ got => $bind_ref1, want => $bind_ref2 })
   );