r35011 - in /trunk/dh-make-perl: lib/Debian/Dependencies.pm t/Dependencies.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Fri May 8 13:56:27 UTC 2009


Author: dmn
Date: Fri May  8 13:56:20 2009
New Revision: 35011

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35011
Log:
Dependencies: add overloading of 'eq' operator

Modified:
    trunk/dh-make-perl/lib/Debian/Dependencies.pm
    trunk/dh-make-perl/t/Dependencies.t

Modified: trunk/dh-make-perl/lib/Debian/Dependencies.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependencies.pm?rev=35011&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/Dependencies.pm (original)
+++ trunk/dh-make-perl/lib/Debian/Dependencies.pm Fri May  8 13:56:20 2009
@@ -7,7 +7,8 @@
 use Debian::Dependency;
 
 use overload '""'   => \&_stringify,
-             '+'    => \&_add;
+             '+'    => \&_add,
+             'eq'   => \&_eq;
 
 =head1 NAME
 
@@ -94,6 +95,13 @@
         push @$left, @$right;
         $left;
     }
+}
+
+sub _eq {
+    my( $left, $right ) = @_;
+
+    # force stringification
+    return "$left" eq "$right";
 }
 
 =back

Modified: trunk/dh-make-perl/t/Dependencies.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/Dependencies.t?rev=35011&op=diff
==============================================================================
--- trunk/dh-make-perl/t/Dependencies.t (original)
+++ trunk/dh-make-perl/t/Dependencies.t Fri May  8 13:56:20 2009
@@ -48,3 +48,5 @@
     bless( { pkg => 'libother-perl' }, 'Debian::Dependency' ),
     '+= works',
 );
+
+ok( $list eq "$dep_string, libother-perl", "eq works" );




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