[libconfig-model-dpkg-perl] 02/02: added tests for all Vcs-* parameters

dod at debian.org dod at debian.org
Tue Jan 21 20:25:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

dod pushed a commit to branch master
in repository libconfig-model-dpkg-perl.

commit 65dcb4f29307a49ef62781501cf71274359c5d69
Author: Dominique Dumont <dod at debian.org>
Date:   Tue Jan 21 21:24:57 2014 +0100

    added tests for all Vcs-* parameters
---
 t/dependency-check.t | 43 +++++++++++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 14 deletions(-)

diff --git a/t/dependency-check.t b/t/dependency-check.t
index 7afe64c..fa36f64 100644
--- a/t/dependency-check.t
+++ b/t/dependency-check.t
@@ -38,10 +38,7 @@ eval { require AptPkg::Config ;} ;
 if ( $@ ) {
     plan skip_all => "AptPkg::Config is not installed";
 }
-elsif ( -r '/etc/debian_version' ) {
-    plan tests => 63;
-}
-else {
+elsif ( not -r '/etc/debian_version' ) {
     plan skip_all => "Not a Debian system";
 }
 
@@ -333,18 +330,36 @@ is($perl_bdi->fetch,"perl","check fixed B-D-I dependency value");
 print scalar $inst->list_changes,"\n" if $trace ;
 is($inst->c_count, 1,"check that fixes are tracked with notify changes") ;
 
-my $vcsb = $control->grab("source Vcs-Browser") ;
+my @vcs_tests = (
+    [ 'Vcs-Browser', 'http://git.debian.org/?p=debian-med/r-cran-stringr.git;a=summary', 'http://anonscm.debian.org/gitweb/?p=debian-med/r-cran-stringr.git;a=summary'],
+    [ 'Vcs-Browser', 'https://svn.debian.org/yadasvn/','http://anonscm.debian.org/viewvc/'],
+    [ 'Vcs-Browser', 'http://bzr.debian.org/loggerhead/','http://anonscm.debian.org/loggerhead/'],
+    [ 'Vcs-Arch',    'http://foo.debian.org/arch/arch/','http://anonscm.debian.org/arch/'],
+    [ 'Vcs-Bzr',     'http://baz.debian.org/','http://anonscm.debian.org/bzr/'],
+    [ 'Vcs-Cvs',     'svn at cvs.alioth.debian.org:/cvsroot/','svn at anonscm.debian.org:/cvs/'],
+    [ 'Vcs-Git',     'http://foo.debian.org/git/bar.git','http://anonscm.debian.org/git/bar.git'],
+    [ 'Vcs-Git',     'git://foo.debian.org/','git://anonscm.debian.org/'],
+    [ 'Vcs-Hg',      'http://foo.debian.org/hg/foo','http://anonscm.debian.org/hg/foo'],
+    [ 'Vcs-Svn',     'svn://foo.debian.org/svn/foo','svn://anonscm.debian.org/foo'],
+);
 
-warning_like {
-    $vcsb->store('http://git.debian.org/?p=debian-med/r-cran-stringr.git;a=summary') ;
-}
-    qr/RL to debian system/,"old URL triggerss a warning";
+foreach my $vt (@vcs_tests) {
+    my ($elt, $urla, $urlb) = @$vt;
+    my $vcs = $control->grab("source $elt") ;
 
-{
-    local $Config::Model::Value::nowarning = 1 ;
-    $vcsb->apply_fixes;
-    ok(1,"apply_fixes on URL done");
+    warning_like {
+        $vcs->store($urla) ;
+    }
+    qr/RL to debian system/,"old URL triggers a warning on $elt";
+
+    {
+        local $Config::Model::Value::nowarning = 1 ;
+        $vcs->apply_fixes;
+        ok(1,"apply_fixes on $elt URL done");
+    }
+    is($vcs->fetch, $urlb,'fixed $elt URL') ;
 }
-is($vcsb->fetch,'http://anonscm.debian.org/gitweb/?p=debian-med/r-cran-stringr.git;a=summary','fixed URL') ;
 
 memory_cycle_ok($model);
+
+done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libconfig-model-dpkg-perl.git



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