our $order_by_asc_significant = 0;
our $sql_differ; # keeps track of differing portion between SQLs
-our $tb = __PACKAGE__->builder;
+our $tb; # not documented, but someone might be overriding it anyway
sub _unpack_arrayrefref {
my $same_bind = eq_bind($bind_ref1, $bind_ref2);
# call Test::Builder::ok
+ my $tb = $tb || __PACKAGE__->builder;
my $ret = $tb->ok($same_sql && $same_bind, $msg);
# add debugging info
my $same_sql = eq_sql($sql1, $sql2);
# call Test::Builder::ok
+ my $tb = $tb || __PACKAGE__->builder;
my $ret = $tb->ok($same_sql, $msg);
# add debugging info
my $same_bind = eq_bind($bind_ref1, $bind_ref2);
# call Test::Builder::ok
+ my $tb = $tb || __PACKAGE__->builder;
my $ret = $tb->ok($same_bind, $msg);
# add debugging info
}
sub diag_where{
+ my $tb = $tb || __PACKAGE__->builder;
$tb->diag("Search term:\n" . &dumper);
}
my $sql1 = shift || '';
my $sql2 = shift || '';
+ my $tb = $tb || __PACKAGE__->builder;
$tb->${\($tb->in_todo ? 'note' : 'diag')} (
"SQL expressions differ\n"
." got: $sql1\n"
sub _bind_differ_diag {
my ($bind_ref1, $bind_ref2) = @_;
+ my $tb = __PACKAGE__->builder;
$tb->${\($tb->in_todo ? 'note' : 'diag')} (
"BIND values differ " . dumper({ got => $bind_ref1, want => $bind_ref2 })
);