r18527 - in /branches/upstream/libdevel-cycle-perl/current: Changes META.yml lib/Devel/Cycle.pm t/Devel-Cycle.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Sat Apr 12 19:44:32 UTC 2008
Author: gregoa-guest
Date: Sat Apr 12 19:44:31 2008
New Revision: 18527
URL: http://svn.debian.org/wsvn/?sc=1&rev=18527
Log:
[svn-upgrade] Integrating new upstream version, libdevel-cycle-perl (1.08)
Modified:
branches/upstream/libdevel-cycle-perl/current/Changes
branches/upstream/libdevel-cycle-perl/current/META.yml
branches/upstream/libdevel-cycle-perl/current/lib/Devel/Cycle.pm
branches/upstream/libdevel-cycle-perl/current/t/Devel-Cycle.t
Modified: branches/upstream/libdevel-cycle-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-cycle-perl/current/Changes?rev=18527&op=diff
==============================================================================
--- branches/upstream/libdevel-cycle-perl/current/Changes (original)
+++ branches/upstream/libdevel-cycle-perl/current/Changes Sat Apr 12 19:44:31 2008
@@ -1,4 +1,7 @@
Revision history for Perl extension Devel::Cycle.
+1.08 Fri Apr 11 17:55:59 EDT 2008
+ - Peter Brakemeier identified and patched bug in which stringified objects could
+ create false positives. Thanks Peter!
1.07 Tue May 23 22:28:03 EDT 2006
- Fixed export_to_level() problem so that Test::Memory::Cycle works again.
Modified: branches/upstream/libdevel-cycle-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-cycle-perl/current/META.yml?rev=18527&op=diff
==============================================================================
--- branches/upstream/libdevel-cycle-perl/current/META.yml (original)
+++ branches/upstream/libdevel-cycle-perl/current/META.yml Sat Apr 12 19:44:31 2008
@@ -1,11 +1,14 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Devel-Cycle
-version: 1.07
-version_from: lib/Devel/Cycle.pm
-installdirs: site
-requires:
+--- #YAML:1.0
+name: Devel-Cycle
+version: 1.08
+abstract: Find memory cycles in objects
+license: ~
+author:
+ - Lincoln Stein <lstein at cshl.edu>
+generated_by: ExtUtils::MakeMaker version 6.44
+distribution_type: module
+requires:
Scalar::Util: 0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: branches/upstream/libdevel-cycle-perl/current/lib/Devel/Cycle.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-cycle-perl/current/lib/Devel/Cycle.pm?rev=18527&op=diff
==============================================================================
--- branches/upstream/libdevel-cycle-perl/current/lib/Devel/Cycle.pm (original)
+++ branches/upstream/libdevel-cycle-perl/current/lib/Devel/Cycle.pm Sat Apr 12 19:44:31 2008
@@ -1,12 +1,12 @@
package Devel::Cycle;
-# $Id: Cycle.pm,v 1.10 2006/05/24 02:29:32 lstein Exp $
+# $Id: Cycle.pm,v 1.11 2008/04/11 21:57:13 lstein Exp $
use 5.006001;
use strict;
use Carp 'croak','carp';
use warnings;
-use Scalar::Util qw(isweak blessed);
+use Scalar::Util qw(isweak blessed refaddr);
my $SHORT_NAME = 'A';
my %SHORT_NAMES;
@@ -17,7 +17,7 @@
our @ISA = qw(Exporter);
our @EXPORT = qw(find_cycle find_weakened_cycle);
our @EXPORT_OK = qw($FORMATTING);
-our $VERSION = '1.07';
+our $VERSION = '1.08';
our $FORMATTING = 'roasted';
our $QUIET = 0;
@@ -88,11 +88,11 @@
# so the test has to happen directly on the reference in the data
# structure being scanned.
- if ($seenit->{$current}) {
+ if ($seenit->{refaddr $current}) {
$callback->(\@report);
return;
}
- $seenit->{$current}++;
+ $seenit->{refaddr $current}++;
my $type = _get_type($current);
Modified: branches/upstream/libdevel-cycle-perl/current/t/Devel-Cycle.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-cycle-perl/current/t/Devel-Cycle.t?rev=18527&op=diff
==============================================================================
--- branches/upstream/libdevel-cycle-perl/current/t/Devel-Cycle.t (original)
+++ branches/upstream/libdevel-cycle-perl/current/t/Devel-Cycle.t Sat Apr 12 19:44:31 2008
@@ -5,7 +5,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
-use Test::More tests => 7;
+use Test::More tests => 8;
use Scalar::Util qw(weaken isweak);
BEGIN { use_ok('Devel::Cycle') };
@@ -57,3 +57,15 @@
find_weakened_cycle($test,sub {$counter++});
is($counter,4,'found four cycles (including weakened ones) in $test after second weaken()');
+my $a = bless {},'foo';
+my $b = bless {},'bar';
+$a->{'b'} = $b;
+$counter = 0;
+find_cycle($a,sub {$counter++});
+is($counter,0,'found no cycles in reference stringified on purpose to create a false alarm');
+
+package foo;
+use overload q("") => sub{ return 1 }; # show false alarm
+
+package bar;
+use overload q("") => sub{ return 1 };
More information about the Pkg-perl-cvs-commits
mailing list