require Class::Struct;
require FileHandle;
require Hash::Merge;
+ require Storable;
no warnings qw/redefine once/;
no strict qw/refs/;
}
my $base_collection = {
- schema => $schema,
- storage => $storage,
-
resultset => $rs,
# twice so that we make sure only one H::M object spawned
result_source => $rs->result_source,
+ result_source_handle => $rs->result_source->handle,
+
fresh_pager => $rs->page(5)->pager,
pager => $pager,
pager_explicit_count => $pager_explicit_count,
- sql_maker => $storage->sql_maker,
- dbh => $storage->_dbh
};
+ %$base_collection = (
+ %$base_collection,
+ refrozen => Storable::dclone( $base_collection ),
+ rerefrozen => Storable::dclone( Storable::dclone( $base_collection ) ),
+ schema => $schema,
+ storage => $storage,
+ sql_maker => $storage->sql_maker,
+ dbh => $storage->_dbh,
+ );
+
memory_cycle_ok ($base_collection, 'No cycles in the object collection')
if $have_test_cycle;
unless $cleared->{hash_merge_singleton}{$weak_registry->{$slot}{weakref}{behavior}}++;
}
elsif ($slot =~ /^__TxnScopeGuard__FIXUP__/) {
- die 'The $@ debacle should have been fixed by now!!!' if $] >= 5.013008;
- delete $weak_registry->{$slot};
+ delete $weak_registry->{$slot}
+ if $] > 5.013001 and $] < 5.013008;
}
}
DBICTest::Schema->source_registrations(undef);
my $tb = Test::More->builder;
-for my $slot (keys %$weak_registry) {
+for my $slot (sort keys %$weak_registry) {
ok (! defined $weak_registry->{$slot}{weakref}, "No leaks of $slot") or do {
my $diag = '';