DBIx-Class-ResultSet-RecursiveUpdate

 view release on metacpan or  search on metacpan

t_dbic/lib/DBICTest/Util.pm  view on Meta::CPAN

package DBICTest::Util;

use warnings;
use strict;

use Carp;
use Scalar::Util qw/isweak weaken blessed reftype refaddr/;
use Config;

use base 'Exporter';
our @EXPORT_OK = qw/local_umask stacktrace populate_weakregistry assert_empty_weakregistry/;

sub local_umask {
  return unless defined $Config{d_umask};

  die 'Calling local_umask() in void context makes no sense'
    if ! defined wantarray;

t_dbic/lib/DBICTest/Util.pm  view on Meta::CPAN

  );

  if (defined $reg->{$slot}{weakref}) {
    if ( refaddr($reg->{$slot}{weakref}) != (refaddr $target) ) {
      print STDERR "Bail out! Weak Registry slot collision: $reg->{$slot}{weakref} / $target\n";
      exit 255;
    }
  }
  else {
    $refs_traced++;
    weaken( $reg->{$slot}{weakref} = $target );
    $reg->{$slot}{stacktrace} = stacktrace(1);
  }

  $target;
}

my $leaks_found;
sub assert_empty_weakregistry {
  my ($weak_registry, $quiet) = @_;



( run in 0.217 second using v1.01-cache-2.11-cpan-65fba6d93b7 )