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

alexm-guest pushed a commit to branch master
in repository pkg-perl-tools.

commit d494134758cbfeb97304d201d7df32e82d01fc8b
Author: Alex Muntada <al...@alexm.org>
Date:   Fri Dec 2 21:51:49 2016 +0100

    Add a test for Debian::PkgPerl::Bug
---
 t/bug.t | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/t/bug.t b/t/bug.t
new file mode 100644
index 0000000..a26422b
--- /dev/null
+++ b/t/bug.t
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+    plan skip_all
+        => "Set AUTHOR_TESTING to perform these tests"
+        unless $ENV{AUTHOR_TESTING};
+
+    plan skip_all
+        => "These tests require LWP::Simple"
+         . " and a working Debian::PkgPerl::Bug"
+        unless eval { use LWP::Simple; 1 }
+        and eval { use Debian::PkgPerl::Bug; 1 };
+}
+
+use Test::RequiresInternet ( 'bugs.debian.org' => 80 );
+use Test::RequiresInternet ( 'bugs.debian.org' => 443 );
+
+my $bugs_html = get('https://bugs.debian.org/src:pkg-perl-tools');
+my @bug_list = $bugs_html =~ /<a href="bugreport\.cgi\?bug=(\d+)">#\1<\/a>/g;
+
+plan skip_all
+    => "No open bugs were found in pkg-perl-tools"
+    unless @bug_list;
+
+note("Bug list: @bug_list");
+
+my $bug_nr = $bug_list[0];
+my $bug = new_ok( 'Debian::PkgPerl::Bug', [ bug => $bug_nr ]);
+
+my %info = $bug->retrieve_bug_info();
+ok( exists $info{Subject}, "retrieve bug $bug_nr info" );
+like( $info{Subject}, qr/\w+/, "bug $bug_nr subject is not empty" );
+note("bug $bug_nr: $info{Subject}");
+
+done_testing();

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

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to