r28064 - /trunk/dh-make-perl/t/Dependencies.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Thu Dec 11 14:26:37 UTC 2008


Author: dmn
Date: Thu Dec 11 14:26:34 2008
New Revision: 28064

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=28064
Log:
add tests for Debian::Dependencies

Added:
    trunk/dh-make-perl/t/Dependencies.t   (with props)

Added: trunk/dh-make-perl/t/Dependencies.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/Dependencies.t?rev=28064&op=file
==============================================================================
--- trunk/dh-make-perl/t/Dependencies.t (added)
+++ trunk/dh-make-perl/t/Dependencies.t Thu Dec 11 14:26:34 2008
@@ -1,0 +1,29 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use Test::More 'no_plan';
+use Test::Deep;
+
+use_ok('Debian::Dependencies');
+
+my $dep_string = 'perl, libfoo-perl (>= 5.7), bar (<= 4)';
+my $list = Debian::Dependencies->new($dep_string);
+
+ok( ref($list), 'parsed dep list is a reference' );
+is( ref($list), 'Debian::Dependencies', 'parsed dep list is an object' );
+is( scalar(@$list), 3, 'parsed deps contain 3 elements' );
+is_deeply( [ map( ref, @$list ) ], [ ( 'Debian::Dependency' ) x 3 ], 'Depencencies list contains Dependency refs' );
+cmp_deeply(
+    $list,
+    bless(
+        [
+            bless( { pkg=>'perl' }, 'Debian::Dependency' ),
+            bless( { pkg=>'libfoo-perl', rel=>'>=', ver=>'5.7' }, 'Debian::Dependency' ),
+            bless( { pkg=>'bar', rel=>'<=', ver=>'4' }, 'Debian::Dependency' ),
+        ],
+        'Debian::Dependencies',
+    ),
+    'Dependencies list parsed' );
+is( "$list", $dep_string, 'Dependencies stringifies' );

Propchange: trunk/dh-make-perl/t/Dependencies.t
------------------------------------------------------------------------------
    svn:executable = *




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