X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg.t;h=f9f61c47d6683d0f85554eb4c71129063e8b7bf8;hb=a780a0ff7c99dd9b640f8c29ad0466bd0c907bf3;hp=cdfce99ed72b3aeeb764898c19abddd9a50bf898;hpb=67b79ae10d09c925c0e120e9de21758f388c8e70;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg.t b/t/72pg.t index cdfce99..f9f61c4 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -32,8 +32,10 @@ DBICTest::Schema->load_classes( map {s/.+:://;$_} @test_classes ) if @test_class # Check that datetime_parser returns correctly before we explicitly connect. SKIP: { - eval { require DateTime::Format::Pg }; - skip "DateTime::Format::Pg required", 2 if $@; + skip ( + "Pg parser detection test needs " . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt_pg'), + 2 + ) unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt_pg'); my $store = ref $s->storage; is($store, 'DBIx::Class::Storage::DBI', 'Started with generic storage'); @@ -223,13 +225,23 @@ for my $use_insert_returning ($test_server_supports_insert_returning arrayfield => [5, 6], }); + my $afield_rs = $schema->resultset('ArrayTest')->search({ + arrayfield => \[ '= ?' => [arrayfield => [3, 4]] ], #Todo anything less ugly than this? + }); + my $count; lives_ok { - $count = $schema->resultset('ArrayTest')->search({ - arrayfield => \[ '= ?' => [arrayfield => [3, 4]] ], #Todo anything less ugly than this? - })->count; + $count = $afield_rs->count } 'comparing arrayref to pg array data does not blow up'; is($count, 1, 'comparing arrayref to pg array data gives correct result'); + + TODO: { + local $TODO = 'No introspection of scalarref conditions :('; + my $row = $afield_rs->create({}); + is_deeply ($row->arrayfield, [3,4], 'Array value taken from $rs condition'); + $row->discard_changes; + is_deeply ($row->arrayfield, [3,4], 'Array value made it to storage'); + } }