revert previous revision
[dbsrgits/DBIx-Class.git] / t / 72pg.t
index 5322543..45e614f 100644 (file)
--- 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);
@@ -133,7 +131,8 @@ is_deeply($type_info, $test_type_info,
           'columns_info_for - column data types');
 
 SKIP: {
-  skip "SQL::Abstract < 1.50 does not pass through arrayrefs", 2 if $SQL::Abstract::VERSION < 1.50;
+  skip "SQL::Abstract < 1.49 does not pass through arrayrefs", 4
+    if $SQL::Abstract::VERSION < 1.49;
 
   lives_ok {
     $schema->resultset('ArrayTest')->create({
@@ -146,6 +145,18 @@ SKIP: {
       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');
 }