[libconfig-model-dpkg-perl] 02/02: fix and improved Testsuite tests

dod at debian.org dod at debian.org
Mon Nov 17 12:24:22 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 af8663ea0e35e5a0ead6ac4a8154998983f9bd6d
Author: Dominique Dumont <dod at debian.org>
Date:   Mon Nov 17 13:18:16 2014 +0100

    fix and improved Testsuite tests
---
 t/dpkg.t | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/t/dpkg.t b/t/dpkg.t
index cfa2526..c61ab05 100644
--- a/t/dpkg.t
+++ b/t/dpkg.t
@@ -20,7 +20,7 @@ if ( $@ ) {
     plan skip_all => "AptPkg::Config is not installed";
 }
 elsif ( -r '/etc/debian_version' ) {
-    plan tests => 18;
+    plan tests => 23;
 }
 else {
     plan skip_all => "Not a Debian system";
@@ -100,7 +100,16 @@ $root->load('control source Maintainer="foo <foo at bar>" ! my_config dependency-fi
 is($root->grab_value("my_config package-dependency-filter:foopkg"),
     'lenny', "check package-dependency-filter");
 
-is($root->grab_value("control source Testsuite"), undef,'check Testsuite default output');
+warning_is {
+    my $ts = $root->grab_value("control source Testsuite");
+}  undef, 'check that Testsuite does not warn for random maintainer ';
+
+warning_like {
+    $root->load('control source Testsuite=autopkgtest-foobar');
+} qr/unknown value/i, "check that a warning is emitted for unknown Testsuite value";
+
+# delete wrong Testsuite value
+$root->load('control source Testsuite~') ;
 
 $root->load('control source Maintainer="Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>"');
 is($root->grab_value("control source Testsuite"), 'autopkgtest-pkg-perl','check Testsuite pkg-perl output');
@@ -108,6 +117,11 @@ is($root->grab_value("control source Testsuite"), 'autopkgtest-pkg-perl','check
 $root->load('control source Maintainer="Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>"');
 is($root->grab_value("control source Testsuite"), 'autopkgtest-pkg-ruby','check Testsuite pkg-ruby output');
 
+warning_like {
+    $root->load('control source Testsuite=autopkgtest-pkg-perl');
+} qr/wrong team value/i, "check that a warning is emitted for Testsuite value mistmatch";
+
+
 
 my $lic_text = $root->grab("copyright License:FooBar text");
 is($lic_text->fetch, undef, "test unknown lic text") ;
@@ -122,4 +136,4 @@ my $lic_gpl = $root->grab("copyright License:GPL-1 text");
 like($lic_gpl->fetch,qr!/usr/share/common-licenses/GPL-1!
      , "retrieved license text summary") ;
 
-memory_cycle_ok($model);
+memory_cycle_ok($model, "check memory cycles");

-- 
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