X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg.t;h=cdf2178d9951c48400b4ca18676b542f360cce43;hb=3ebc5603d1fb51f7d15c18c1d80a043495d93f9e;hp=4e789ab9cbfd9e48ec95dc39c5c27e113f4cb2b2;hpb=9ba627e345cd5e16077d4a56889f9b5d13b6e0a9;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/72pg.t b/t/72pg.t index 4e789ab..cdf2178 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -38,16 +38,14 @@ use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; -#warn "$dsn $user $pass"; - plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test '. '(note: This test drops and creates tables called \'artist\', \'casecheck\', \'array_test\' and \'sequence_test\''. ' as well as following sequences: \'pkid1_seq\', \'pkid2_seq\' and \'nonpkid_seq\''. ' as well as following schemas: \'testschema\'!)' - unless ($dsn && $user && $pass); + unless ($dsn && $user); -plan tests => 35; +plan tests => 37; DBICTest::Schema->load_classes( 'Casecheck', 'ArrayTest' ); my $schema = DBICTest::Schema->connect($dsn, $user, $pass); @@ -132,9 +130,7 @@ like($artistid_defval, is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); -TODO: { - local $TODO = "it seems that DBI/DBD::Pg does not accept arrayrefs as bind values for pg arrays"; - +{ lives_ok { $schema->resultset('ArrayTest')->create({ arrayfield => [1, 2], @@ -146,6 +142,18 @@ TODO: { arrayfield => [3, 4], }); } 'updating arrayref as pg array data'; + + $schema->resultset('ArrayTest')->create({ + arrayfield => [5, 6], + }); + + my $count; + lives_ok { + $count = $schema->resultset('ArrayTest')->search({ + arrayfield => \[ '= ?' => [arrayfield => [3, 4]] ], #TODO anything less ugly than this? + })->count; + } 'comparing arrayref to pg array data does not blow up'; + is($count, 1, 'comparing arrayref to pg array data gives correct result'); }