X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Finflate%2Fhri.t;h=b5e9d2f542c5e336bf2922aee2a0165cf47645dc;hb=4f29a592f18106f2b06660a1cb82911b0ebc2011;hp=eaf9128228d392b7a78d584034ce98a708b4af06;hpb=8273e845426f0187b4ad6c4a1b42286fa09a648f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/inflate/hri.t b/t/inflate/hri.t index eaf9128..b5e9d2f 100644 --- a/t/inflate/hri.t +++ b/t/inflate/hri.t @@ -2,6 +2,14 @@ use strict; use warnings; use Test::More; + +use DBIx::Class::_Util 'modver_gt_or_eq_and_lt'; +use base(); +BEGIN { + plan skip_all => 'base.pm 2.20 (only present in perl 5.19.7) is known to break this test' + if modver_gt_or_eq_and_lt( 'base', '2.19_01', '2.21' ); +} + use Test::Exception; use lib qw(t/lib); use DBICTest; @@ -34,13 +42,13 @@ my $schema = DBICTest->init_schema(); is ($rs->result_class, 'DBICTest::CDSubclass', 'original class unchanged'); is ($hri_rs->result_class, 'DBIx::Class::ResultClass::HashRefInflator', 'result_class accessor pre-set via attribute'); - my $datahashref1 = $hri_rs->next; is_deeply( [ sort keys %$datahashref1 ], [ sort $rs->result_source->columns ], 'returned correct columns', ); + $hri_rs->reset; $cd = $hri_rs->find ({cdid => 1}); is_deeply ( $cd, $datahashref1, 'first/find return the same thing (result_class attr propagates)'); @@ -87,7 +95,7 @@ sub check_cols_of { my @dbic_reltable = $dbic_obj->$col; my @hashref_reltable = @{$datahashref->{$col}}; - is (scalar @dbic_reltable, scalar @hashref_reltable, 'number of related entries'); + is (scalar @hashref_reltable, scalar @dbic_reltable, 'number of related entries'); # for my $index (0..scalar @hashref_reltable) { for my $index (0..scalar @dbic_reltable) {