r20642 - in /branches/upstream/libtest-deep-perl/current: CHANGES META.yml lib/Test/Deep.pm lib/Test/Deep.pod t/isa.t

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Tue Jun 3 13:02:53 UTC 2008


Author: emhn-guest
Date: Tue Jun  3 13:02:53 2008
New Revision: 20642

URL: http://svn.debian.org/wsvn/?sc=1&rev=20642
Log:
[svn-upgrade] Integrating new upstream version, libtest-deep-perl (0.103)

Modified:
    branches/upstream/libtest-deep-perl/current/CHANGES
    branches/upstream/libtest-deep-perl/current/META.yml
    branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pm
    branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pod
    branches/upstream/libtest-deep-perl/current/t/isa.t

Modified: branches/upstream/libtest-deep-perl/current/CHANGES
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-deep-perl/current/CHANGES?rev=20642&op=diff
==============================================================================
--- branches/upstream/libtest-deep-perl/current/CHANGES (original)
+++ branches/upstream/libtest-deep-perl/current/CHANGES Tue Jun  3 13:02:53 2008
@@ -1,3 +1,9 @@
+0.103
+
+Detect whether isa() is being called with 1 or 2 arguments and
+dispatch to the correct function. This is hacky but fixes the problem
+of clashing with UNIVERSAL::isa().
+
 0.102
 
 Behave well when a code comparator doesn't give diagnostics. Thanks to

Modified: branches/upstream/libtest-deep-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-deep-perl/current/META.yml?rev=20642&op=diff
==============================================================================
--- branches/upstream/libtest-deep-perl/current/META.yml (original)
+++ branches/upstream/libtest-deep-perl/current/META.yml Tue Jun  3 13:02:53 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Test-Deep
-version:      0.102
+version:      0.103
 version_from: ./lib/Test/Deep.pm
 installdirs:  perl
 requires:

Modified: branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pm?rev=20642&op=diff
==============================================================================
--- branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pm (original)
+++ branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pm Tue Jun  3 13:02:53 2008
@@ -25,7 +25,7 @@
 	$Snobby $Expects $DNE $DNE_ADDR $Shallow
 );
 
-$VERSION = '0.102';
+$VERSION = '0.103';
 
 require Exporter;
 @ISA = qw( Exporter );
@@ -66,7 +66,7 @@
 	Shallow => "",
 	Any => "",
 	All => "",
-	Isa => "",
+	Isa => "Isa",
 	RegexpRefOnly => "",
 	RefType => "",
 	Blessed => "",
@@ -99,6 +99,25 @@
 	$count{$e}++;
 }
 
+# this is ugly, I should never have exported a sub called isa now I
+# have to try figure out if the recipient wanted my isa or if a class
+# imported us and UNIVERSAL::isa is being called on that class.
+# Luckily our isa always expects 1 argument and U::isa always expects
+# 2, so we can figure out (assuming the caller is no buggy).
+sub isa
+{
+	if (@_ == 1)
+	{
+		goto &Isa;
+	}
+	else
+	{
+		goto &UNIVERSAL::isa;
+	}
+}
+
+push(@EXPORT, "isa");
+
 sub cmp_deeply
 {
 	my ($d1, $d2, $name) = @_;

Modified: branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pod
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pod?rev=20642&op=diff
==============================================================================
--- branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pod (original)
+++ branches/upstream/libtest-deep-perl/current/lib/Test/Deep.pod Tue Jun  3 13:02:53 2008
@@ -648,12 +648,20 @@
 
 You can also use overloading with | similarly to all().
 
-=head3 isa($class)
+=head3 isa($class), Isa($class)
 
 $class is a class name.
 
 This uses UNIVERSAL::isa() to check that $got_v is blessed into the class
 $class.
+
+B<NOTE:> Isa() does exactly as documented here, isa() is slightly
+different. If isa() is called with 1 argument it falls through to
+Isa(). If isa() called with 2 arguments, it falls through to
+UNIVERAL::isa. This is to prevent breakage when you import isa() into
+a package that is used as a class. Without this, anyone calling
+C<Class-E<gt>isa($other_class)> would get the wrong answer. This is a
+hack to patch over the fact that isa is exported by default.
 
 =head3 array_each($thing)
 

Modified: branches/upstream/libtest-deep-perl/current/t/isa.t
URL: http://svn.debian.org/wsvn/branches/upstream/libtest-deep-perl/current/t/isa.t?rev=20642&op=diff
==============================================================================
--- branches/upstream/libtest-deep-perl/current/t/isa.t (original)
+++ branches/upstream/libtest-deep-perl/current/t/isa.t Tue Jun  3 13:02:53 2008
@@ -62,3 +62,14 @@
 		"isa eq"
 	);
 }
+
+package A;
+
+use Test::Deep;
+ at A::ISA = qw( Test::Deep );
+
+{
+	::ok(A->isa("Test::Deep"), "U::isa says yes");
+	::ok(! A->isa("Test"), "U::isa says yes");
+}
+




More information about the Pkg-perl-cvs-commits mailing list