X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg_bytea.t;h=15f8db5f224888eb4c40f7a563d46d7057c8693d;hb=8aae794001ecccdb26c2bbd1b92c97bba9e65d79;hp=c18faba89484afb9b3adfe19d14215340ff30b93;hpb=74b5397c077a964ed301d18f5ccda72afa91f353;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg_bytea.t b/t/72pg_bytea.t index c18faba..15f8db5 100644 --- a/t/72pg_bytea.t +++ b/t/72pg_bytea.t @@ -1,32 +1,24 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +use DBIx::Class::Optional::Dependencies -skip_all_without => qw(test_rdbms_pg binary_data); + use strict; use warnings; use Test::More; -use DBIx::Class::Optional::Dependencies (); -use Try::Tiny; -use lib qw(t/lib); -use DBICTest; +use DBIx::Class::_Util 'modver_gt_or_eq'; -plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg') - unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg'); -my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; +use DBICTest; -plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test' - unless ($dsn && $dbuser); +my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; -my $schema = DBICTest->connect_schema($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); +my $schema = DBICTest::Schema->connect($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); -if ($schema->storage->_server_info->{normalized_dbms_version} >= 9.0) { - if (not try { DBD::Pg->VERSION('2.17.2') }) { - plan skip_all => - 'DBD::Pg < 2.17.2 does not work with Pg >= 9.0 BYTEA columns'; - } -} -elsif (not try { DBD::Pg->VERSION('2.9.2') }) { - plan skip_all => - 'DBD::Pg < 2.9.2 does not work with BYTEA columns'; -} +plan skip_all => 'DBD::Pg < 2.17.2 does not work with Pg >= 9.0 BYTEA columns' if ( + ! modver_gt_or_eq('DBD::Pg', '2.17.2') + and + $schema->storage->_server_info->{normalized_dbms_version} >= 9.0 +); my $dbh = $schema->storage->dbh; @@ -41,9 +33,7 @@ my $dbh = $schema->storage->dbh; id serial NOT NULL PRIMARY KEY, bytea bytea NULL, blob bytea NULL, - blob2 bytea NULL, clob text NULL, - clob2 text NULL, a_memo text NULL ); ],{ RaiseError => 1, PrintError => 1 });