From: Peter Rabbitson Date: Mon, 26 May 2014 11:47:52 +0000 (+0200) Subject: Retire DBIC/SqlMakerTest.pm now that SQLA::Test provides the same function X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a5a7bb733a940db710b7408508374833683a2e79;p=dbsrgits%2FDBIx-Class-Historic.git Retire DBIC/SqlMakerTest.pm now that SQLA::Test provides the same function --- diff --git a/t/60core.t b/t/60core.t index f2e363a..62299c3 100644 --- a/t/60core.t +++ b/t/60core.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use Test::Warn; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/71mysql.t b/t/71mysql.t index 52d097d..bebbc4b 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -11,7 +11,6 @@ use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mysql') unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mysql'); diff --git a/t/73oracle.t b/t/73oracle.t index 40dcaac..bdcc732 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -9,7 +9,6 @@ use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/}; diff --git a/t/73oracle_blob.t b/t/73oracle_blob.t index c2fa413..2a78d36 100644 --- a/t/73oracle_blob.t +++ b/t/73oracle_blob.t @@ -9,7 +9,6 @@ use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/}; diff --git a/t/76joins.t b/t/76joins.t index 934e387..66e9fb7 100644 --- a/t/76joins.t +++ b/t/76joins.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/76select.t b/t/76select.t index dca5654..81ecf0d 100644 --- a/t/76select.t +++ b/t/76select.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/88result_set_column.t b/t/88result_set_column.t index 226c209..9a04bd1 100644 --- a/t/88result_set_column.t +++ b/t/88result_set_column.t @@ -5,8 +5,7 @@ use Test::More; use Test::Warn; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/90join_torture.t b/t/90join_torture.t index 2bc86b2..27111e4 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); lives_ok (sub { diff --git a/t/count/count_rs.t b/t/count/count_rs.t index 5883daf..174f630 100644 --- a/t/count/count_rs.t +++ b/t/count/count_rs.t @@ -4,8 +4,7 @@ use warnings; use lib qw(t/lib); use Test::More; -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($ROWS, $OFFSET) = ( diff --git a/t/count/distinct.t b/t/count/distinct.t index 1b44b9a..e916ab9 100644 --- a/t/count/distinct.t +++ b/t/count/distinct.t @@ -6,8 +6,7 @@ use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/count/in_subquery.t b/t/count/in_subquery.t index 8f56d83..85f48d0 100644 --- a/t/count/in_subquery.t +++ b/t/count/in_subquery.t @@ -5,7 +5,6 @@ use Test::More; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my $schema = DBICTest->init_schema(); diff --git a/t/count/prefetch.t b/t/count/prefetch.t index 25ae856..eb18236 100644 --- a/t/count/prefetch.t +++ b/t/count/prefetch.t @@ -4,8 +4,7 @@ use warnings; use lib qw(t/lib); use Test::More; -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/lib/DBIC/SqlMakerTest.pm b/t/lib/DBIC/SqlMakerTest.pm deleted file mode 100644 index 8fd047c..0000000 --- a/t/lib/DBIC/SqlMakerTest.pm +++ /dev/null @@ -1,165 +0,0 @@ -package DBIC::SqlMakerTest; - -use strict; -use warnings; - -use base qw/Exporter/; - -use Carp; -use SQL::Abstract::Test; - -our @EXPORT = qw/ - is_same_sql_bind - is_same_sql - is_same_bind -/; -our @EXPORT_OK = qw/ - eq_sql - eq_bind - eq_sql_bind -/; - -sub is_same_sql_bind { - # unroll possible as_query arrayrefrefs - my @args; - - for (1,2) { - my $chunk = shift @_; - - if ( ref $chunk eq 'REF' and ref $$chunk eq 'ARRAY' ) { - my ($sql, @bind) = @$$chunk; - push @args, ($sql, \@bind); - } - else { - push @args, $chunk, shift @_; - } - - } - - push @args, shift @_; - - croak "Unexpected argument(s) supplied to is_same_sql_bind: " . join ('; ', @_) - if @_; - - @_ = @args; - goto &SQL::Abstract::Test::is_same_sql_bind; -} - -*is_same_sql = \&SQL::Abstract::Test::is_same_sql; -*is_same_bind = \&SQL::Abstract::Test::is_same_bind; -*eq_sql = \&SQL::Abstract::Test::eq_sql; -*eq_bind = \&SQL::Abstract::Test::eq_bind; -*eq_sql_bind = \&SQL::Abstract::Test::eq_sql_bind; - -1; - -__END__ - - -=head1 NAME - -DBIC::SqlMakerTest - Helper package for testing sql_maker component of DBIC - -=head1 SYNOPSIS - - use Test::More; - use DBIC::SqlMakerTest; - - my ($sql, @bind) = $schema->storage->sql_maker->select(%args); - is_same_sql_bind( - $sql, \@bind, - $expected_sql, \@expected_bind, - 'foo bar works' - ); - -=head1 DESCRIPTION - -Exports functions that can be used to compare generated SQL and bind values. - -This is a thin wrapper around L, which makes it easier -to compare as_query sql/bind arrayrefrefs directly. - -=head1 FUNCTIONS - -=head2 is_same_sql_bind - - is_same_sql_bind( - $given_sql, \@given_bind, - $expected_sql, \@expected_bind, - $test_msg - ); - - is_same_sql_bind( - $rs->as_query - $expected_sql, \@expected_bind, - $test_msg - ); - - is_same_sql_bind( - \[$given_sql, @given_bind], - $expected_sql, \@expected_bind, - $test_msg - ); - -Compares given and expected pairs of C<($sql, \@bind)>, and calls -L on the result, with C<$test_msg> as message. - -=head2 is_same_sql - - is_same_sql( - $given_sql, - $expected_sql, - $test_msg - ); - -Compares given and expected SQL statement, and calls L on the -result, with C<$test_msg> as message. - -=head2 is_same_bind - - is_same_bind( - \@given_bind, - \@expected_bind, - $test_msg - ); - -Compares given and expected bind value lists, and calls L on -the result, with C<$test_msg> as message. - -=head2 eq_sql - - my $is_same = eq_sql($given_sql, $expected_sql); - -Compares the two SQL statements. Returns true IFF they are equivalent. - -=head2 eq_bind - - my $is_same = eq_sql(\@given_bind, \@expected_bind); - -Compares two lists of bind values. Returns true IFF their values are the same. - -=head2 eq_sql_bind - - my $is_same = eq_sql_bind( - $given_sql, \@given_bind, - $expected_sql, \@expected_bind - ); - -Compares the two SQL statements and the two lists of bind values. Returns true -IFF they are equivalent and the bind values are the same. - - -=head1 SEE ALSO - -L, L, L. - -=head1 AUTHOR - -Norbert Buchmuller, - -=head1 COPYRIGHT AND LICENSE - -Copyright 2008 by Norbert Buchmuller. - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 4a9307d..432eb87 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -20,7 +20,7 @@ BEGIN { use Module::Runtime 'module_notional_filename'; BEGIN { - for my $mod (qw( DBIC::SqlMakerTest SQL::Abstract )) { + for my $mod (qw( SQL::Abstract::Test SQL::Abstract )) { if ( $INC{ module_notional_filename($mod) } ) { # FIXME this does not seem to work in BEGIN - why?! #require Carp; @@ -48,7 +48,7 @@ use Config; =head1 NAME -DBICTest - Library to be used by DBIx::Class test scripts. +DBICTest - Library to be used by DBIx::Class test scripts =head1 SYNOPSIS @@ -63,6 +63,26 @@ DBICTest - Library to be used by DBIx::Class test scripts. This module provides the basic utilities to write tests against DBIx::Class. +=head1 EXPORTS + +The module does not export anything by default, nor provides individual +function exports in the conventional sense. Instead the following tags are +recognized: + +=head2 :DiffSQL + +Same as C +L +L)> + +=head2 :GlobalLock + +Some tests are very time sensitive and need to run on their own, without +being disturbed by anything else grabbing CPU or disk IO. Hence why everything +using C grabs a shared lock, and the few tests that request a +C<:GlobalLock> will ask for an exclusive one and block until they can get it. + =head1 METHODS =head2 init_schema @@ -79,18 +99,15 @@ DBIx::Class. This method removes the test SQLite database in t/var/DBIxClass.db and then creates a new, empty database. -This method will call deploy_schema() by default, unless the -no_deploy flag is set. +This method will call L by default, unless the +C flag is set. -Also, by default, this method will call populate_schema() by -default, unless the no_deploy or no_populate flags are set. +Also, by default, this method will call L +by default, unless the C or C flags are set. =cut -# some tests are very time sensitive and need to run on their own, without -# being disturbed by anything else grabbing CPU or disk IO. Hence why everything -# using DBICTest grabs a shared lock, and the few tests that request a :GlobalLock -# will ask for an exclusive one and block until they can get it +# see L our ($global_lock_fh, $global_exclusive_lock); sub import { my $self = shift; @@ -103,13 +120,21 @@ sub import { or die "Unable to open $lockpath: $!"; } - for (@_) { - if ($_ eq ':GlobalLock') { + for my $exp (@_) { + if ($exp eq ':GlobalLock') { flock ($global_lock_fh, LOCK_EX) or die "Unable to lock $lockpath: $!"; $global_exclusive_lock = 1; } + elsif ($exp eq ':DiffSQL') { + require SQL::Abstract::Test; + my $into = caller(0); + for (qw(is_same_sql_bind is_same_sql is_same_bind)) { + no strict 'refs'; + *{"${into}::$_"} = \&{"SQL::Abstract::Test::$_"}; + } + } else { - croak "Unknown export $_ requested from $self"; + croak "Unknown export $exp requested from $self"; } } diff --git a/t/prefetch/correlated.t b/t/prefetch/correlated.t index ac809f3..6c2e0b7 100644 --- a/t/prefetch/correlated.t +++ b/t/prefetch/correlated.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use Test::Deep; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/count.t b/t/prefetch/count.t index 8fb2442..f973575 100644 --- a/t/prefetch/count.t +++ b/t/prefetch/count.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/double_prefetch.t b/t/prefetch/double_prefetch.t index d4b50aa..fa0b79f 100644 --- a/t/prefetch/double_prefetch.t +++ b/t/prefetch/double_prefetch.t @@ -3,8 +3,7 @@ use strict; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/grouped.t b/t/prefetch/grouped.t index c9a91c4..a1b9860 100644 --- a/t/prefetch/grouped.t +++ b/t/prefetch/grouped.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; diff --git a/t/prefetch/incomplete.t b/t/prefetch/incomplete.t index 09df99c..63e431a 100644 --- a/t/prefetch/incomplete.t +++ b/t/prefetch/incomplete.t @@ -5,8 +5,7 @@ use Test::More; use Test::Deep; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index ac839f0..f2980e7 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -3,8 +3,7 @@ use strict; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/o2m_o2m_order_by_with_limit.t b/t/prefetch/o2m_o2m_order_by_with_limit.t index b8a4477..65a2c39 100644 --- a/t/prefetch/o2m_o2m_order_by_with_limit.t +++ b/t/prefetch/o2m_o2m_order_by_with_limit.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($ROWS, $OFFSET) = ( diff --git a/t/prefetch/with_limit.t b/t/prefetch/with_limit.t index 4d08cd0..28b3b8a 100644 --- a/t/prefetch/with_limit.t +++ b/t/prefetch/with_limit.t @@ -6,8 +6,7 @@ use warnings; use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; diff --git a/t/relationship/core.t b/t/relationship/core.t index 504993d..46e655c 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/custom.t b/t/relationship/custom.t index 98b8b45..3d47fb1 100644 --- a/t/relationship/custom.t +++ b/t/relationship/custom.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/update_or_create_multi.t b/t/relationship/update_or_create_multi.t index 040baf7..5dde83d 100644 --- a/t/relationship/update_or_create_multi.t +++ b/t/relationship/update_or_create_multi.t @@ -6,7 +6,6 @@ use Test::Exception; use Test::Warn; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/as_query.t b/t/resultset/as_query.t index 39bf88c..3b43e9c 100644 --- a/t/resultset/as_query.t +++ b/t/resultset/as_query.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); my $art_rs = $schema->resultset('Artist'); diff --git a/t/resultset/as_subselect_rs.t b/t/resultset/as_subselect_rs.t index 250785c..6d75977 100644 --- a/t/resultset/as_subselect_rs.t +++ b/t/resultset/as_subselect_rs.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index 71d1b97..7f25d99 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/search/distinct.t b/t/search/distinct.t index 07ac209..4a80267 100644 --- a/t/search/distinct.t +++ b/t/search/distinct.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/preserve_original_rs.t b/t/search/preserve_original_rs.t index 04dc9a8..abb6544 100644 --- a/t/search/preserve_original_rs.t +++ b/t/search/preserve_original_rs.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use Storable 'dclone'; diff --git a/t/search/related_has_many.t b/t/search/related_has_many.t index 1834d53..91b1fb7 100644 --- a/t/search/related_has_many.t +++ b/t/search/related_has_many.t @@ -5,7 +5,6 @@ use Test::More; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my $schema = DBICTest->init_schema(); diff --git a/t/search/related_strip_prefetch.t b/t/search/related_strip_prefetch.t index 76336b1..5e34fe9 100644 --- a/t/search/related_strip_prefetch.t +++ b/t/search/related_strip_prefetch.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; diff --git a/t/search/select_chains.t b/t/search/select_chains.t index 257b0b3..ed8f23b 100644 --- a/t/search/select_chains.t +++ b/t/search/select_chains.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/select_chains_unbalanced.t b/t/search/select_chains_unbalanced.t index d742fd6..63de73c 100644 --- a/t/search/select_chains_unbalanced.t +++ b/t/search/select_chains_unbalanced.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/subquery.t b/t/search/subquery.t index a281fe9..87195fd 100644 --- a/t/search/subquery.t +++ b/t/search/subquery.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; diff --git a/t/sqlmaker/bind_transport.t b/t/sqlmaker/bind_transport.t index bafe8e9..2d33352 100644 --- a/t/sqlmaker/bind_transport.t +++ b/t/sqlmaker/bind_transport.t @@ -6,8 +6,7 @@ use Test::Exception; use Math::BigInt; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($ROWS, $OFFSET) = ( diff --git a/t/sqlmaker/core.t b/t/sqlmaker/core.t index 57cf480..1c2a1c3 100644 --- a/t/sqlmaker/core.t +++ b/t/sqlmaker/core.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(no_deploy => 1); diff --git a/t/sqlmaker/core_quoted.t b/t/sqlmaker/core_quoted.t index 53ce03b..e90befe 100644 --- a/t/sqlmaker/core_quoted.t +++ b/t/sqlmaker/core_quoted.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/dbihacks_internals.t b/t/sqlmaker/dbihacks_internals.t index f3d240f..de5e49e 100644 --- a/t/sqlmaker/dbihacks_internals.t +++ b/t/sqlmaker/dbihacks_internals.t @@ -4,9 +4,8 @@ use Test::More; use Test::Warn; use lib qw(t/lib); -use DBICTest; +use DBICTest ':DiffSQL'; -use DBIC::SqlMakerTest; use Data::Dumper; my $schema = DBICTest->init_schema( no_deploy => 1); diff --git a/t/sqlmaker/hierarchical/oracle.t b/t/sqlmaker/hierarchical/oracle.t index 1283140..33cfeee 100644 --- a/t/sqlmaker/hierarchical/oracle.t +++ b/t/sqlmaker/hierarchical/oracle.t @@ -23,9 +23,7 @@ BEGIN { ); } -use DBICTest; -use DBICTest::Schema; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $ROWS = DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype; diff --git a/t/sqlmaker/limit_dialects/custom.t b/t/sqlmaker/limit_dialects/custom.t index c5e61c6..89c4788 100644 --- a/t/sqlmaker/limit_dialects/custom.t +++ b/t/sqlmaker/limit_dialects/custom.t @@ -5,9 +5,7 @@ use Test::More; use Test::Warn; use lib qw(t/lib); -use DBICTest; -use DBICTest::Schema; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; # This is legacy stuff from SQL::Absract::Limit # Keep it around just in case someone is using it diff --git a/t/sqlmaker/limit_dialects/fetch_first.t b/t/sqlmaker/limit_dialects/fetch_first.t index c521b52..ab3e170 100644 --- a/t/sqlmaker/limit_dialects/fetch_first.t +++ b/t/sqlmaker/limit_dialects/fetch_first.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/sqlmaker/limit_dialects/first_skip.t b/t/sqlmaker/limit_dialects/first_skip.t index 539855c..acaf770 100644 --- a/t/sqlmaker/limit_dialects/first_skip.t +++ b/t/sqlmaker/limit_dialects/first_skip.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($LIMIT, $OFFSET) = ( diff --git a/t/sqlmaker/limit_dialects/generic_subq.t b/t/sqlmaker/limit_dialects/generic_subq.t index ef899ff..2d4beda 100644 --- a/t/sqlmaker/limit_dialects/generic_subq.t +++ b/t/sqlmaker/limit_dialects/generic_subq.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); use List::Util 'min'; -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($ROWS, $TOTAL, $OFFSET) = ( DBIx::Class::SQLMaker::LimitDialects->__rows_bindtype, diff --git a/t/sqlmaker/limit_dialects/mssql_torture.t b/t/sqlmaker/limit_dialects/mssql_torture.t index 7806dfb..e452953 100644 --- a/t/sqlmaker/limit_dialects/mssql_torture.t +++ b/t/sqlmaker/limit_dialects/mssql_torture.t @@ -2,8 +2,7 @@ use strict; use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $OFFSET = DBIx::Class::SQLMaker::LimitDialects->__offset_bindtype; my $TOTAL = DBIx::Class::SQLMaker::LimitDialects->__total_bindtype; diff --git a/t/sqlmaker/limit_dialects/rno.t b/t/sqlmaker/limit_dialects/rno.t index 32f67c5..b317792 100644 --- a/t/sqlmaker/limit_dialects/rno.t +++ b/t/sqlmaker/limit_dialects/rno.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($TOTAL, $OFFSET) = ( diff --git a/t/sqlmaker/limit_dialects/rownum.t b/t/sqlmaker/limit_dialects/rownum.t index 6985c23..806bba4 100644 --- a/t/sqlmaker/limit_dialects/rownum.t +++ b/t/sqlmaker/limit_dialects/rownum.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($TOTAL, $OFFSET, $ROWS) = ( diff --git a/t/sqlmaker/limit_dialects/skip_first.t b/t/sqlmaker/limit_dialects/skip_first.t index ba2d8cf..a87b95e 100644 --- a/t/sqlmaker/limit_dialects/skip_first.t +++ b/t/sqlmaker/limit_dialects/skip_first.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my ($LIMIT, $OFFSET) = ( diff --git a/t/sqlmaker/limit_dialects/toplimit.t b/t/sqlmaker/limit_dialects/toplimit.t index 88c99a6..3fb03d9 100644 --- a/t/sqlmaker/limit_dialects/toplimit.t +++ b/t/sqlmaker/limit_dialects/toplimit.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/sqlmaker/limit_dialects/torture.t b/t/sqlmaker/limit_dialects/torture.t index 74e60a2..c14ea60 100644 --- a/t/sqlmaker/limit_dialects/torture.t +++ b/t/sqlmaker/limit_dialects/torture.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use Storable 'dclone'; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; my $native_limit_dialect = $schema->storage->sql_maker->{limit_dialect}; diff --git a/t/sqlmaker/msaccess.t b/t/sqlmaker/msaccess.t index 2805d03..0333cb2 100644 --- a/t/sqlmaker/msaccess.t +++ b/t/sqlmaker/msaccess.t @@ -2,8 +2,7 @@ use strict; use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; # the entire point of the subclass is that parenthesis have to be # just right for ACCESS to be happy diff --git a/t/sqlmaker/mysql.t b/t/sqlmaker/mysql.t index 5b3f330..6fb1526 100644 --- a/t/sqlmaker/mysql.t +++ b/t/sqlmaker/mysql.t @@ -4,9 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBICTest::Schema; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest::Schema->connect (DBICTest->_database, { quote_char => '`' }); # cheat diff --git a/t/sqlmaker/nest_deprec.t b/t/sqlmaker/nest_deprec.t index f00443a..a6edeee 100644 --- a/t/sqlmaker/nest_deprec.t +++ b/t/sqlmaker/nest_deprec.t @@ -5,8 +5,7 @@ use Test::More; use Test::Warn; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/oracle.t b/t/sqlmaker/oracle.t index 69234f9..b474600 100644 --- a/t/sqlmaker/oracle.t +++ b/t/sqlmaker/oracle.t @@ -11,8 +11,7 @@ BEGIN { use Test::Exception; use Data::Dumper::Concise; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::Oracle; # diff --git a/t/sqlmaker/oraclejoin.t b/t/sqlmaker/oraclejoin.t index 3ba82ab..c1725e0 100644 --- a/t/sqlmaker/oraclejoin.t +++ b/t/sqlmaker/oraclejoin.t @@ -10,9 +10,8 @@ BEGIN { } use lib qw(t/lib); -use DBICTest; +use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::OracleJoins; -use DBIC::SqlMakerTest; my $sa = DBIx::Class::SQLMaker::OracleJoins->new; diff --git a/t/sqlmaker/order_by_bindtransport.t b/t/sqlmaker/order_by_bindtransport.t index b612375..24da80e 100644 --- a/t/sqlmaker/order_by_bindtransport.t +++ b/t/sqlmaker/order_by_bindtransport.t @@ -5,8 +5,7 @@ use Test::More; use Test::Exception; use Data::Dumper::Concise; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; sub test_order { my $rs = shift; diff --git a/t/sqlmaker/order_by_func.t b/t/sqlmaker/order_by_func.t index 51968ed..9609219 100644 --- a/t/sqlmaker/order_by_func.t +++ b/t/sqlmaker/order_by_func.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/quotes.t b/t/sqlmaker/quotes.t index d3a8c8f..4a5357b 100644 --- a/t/sqlmaker/quotes.t +++ b/t/sqlmaker/quotes.t @@ -4,8 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema( no_deploy => 1 ); diff --git a/t/sqlmaker/sqlite.t b/t/sqlmaker/sqlite.t index 86fcc82..9c0b904 100644 --- a/t/sqlmaker/sqlite.t +++ b/t/sqlmaker/sqlite.t @@ -3,8 +3,7 @@ use warnings; use Test::More; use lib qw(t/lib); -use DBICTest; -use DBIC::SqlMakerTest; +use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/storage/debug.t b/t/storage/debug.t index 514b43b..d16e129 100644 --- a/t/storage/debug.t +++ b/t/storage/debug.t @@ -6,7 +6,6 @@ use Test::More; use Test::Exception; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; use Path::Class qw/file/; BEGIN { delete @ENV{qw(DBIC_TRACE DBIC_TRACE_PROFILE DBICTEST_SQLITE_USE_FILE)} } diff --git a/t/storage/ping_count.t b/t/storage/ping_count.t index a17c382..28af647 100644 --- a/t/storage/ping_count.t +++ b/t/storage/ping_count.t @@ -4,7 +4,6 @@ use warnings; use Test::More; use lib qw(t/lib); use DBICTest; -use DBIC::SqlMakerTest; my $ping_count = 0;