8 eval { require Test::Memory::Cycle; require Devel::Cycle };
9 if ($@ or Devel::Cycle->VERSION < 1.10) {
10 plan skip_all => "leak test needs Test::Memory::Cycle and Devel::Cycle >= 1.10";
18 import Test::Memory::Cycle;
23 my $s = $weak->{schema} = DBICTest->init_schema;
24 memory_cycle_ok($s, 'No cycles in schema');
26 my $rs = $weak->{resultset} = $s->resultset ('Artist');
27 memory_cycle_ok($rs, 'No cycles in resultset');
29 my $rsrc = $weak->{resultsource} = $rs->result_source;
30 memory_cycle_ok($rsrc, 'No cycles in resultsource');
32 my $row = $weak->{row} = $rs->first;
33 memory_cycle_ok($row, 'No cycles in row');
35 Scalar::Util::weaken ($_) for values %$weak;
36 memory_cycle_ok($weak, 'No cycles in weak object collection');
40 ok (! $weak->{$_}, "No $_ leaks");