(\d+(?:,\s+\d+)*(?:\,?\s+and\s+\d+)?)}
{$1.(defined $3?$2.bug_links(bug=>$3):'').$4.
english_join([map {bug_links(bug=>$_)} (split /\,?\s+(?:and\s+)?/, $5)])}xeo;
+ $output =~ s{([Aa]dded|[Rr]emoved)( indication that bug )(\d+)( blocks )([\d\s\,]+)}
+ {$1.$2.(bug_links(bug=>$3)).$4.
+ english_join([map {bug_links(bug=>$_)} (split /\,?\s+(?:and\s+)?/, $5)])}eo;
# Add links to reassigned packages
$output =~ s{(Bug reassigned from package \`)([^']+?)((?:'|\&\#39;) to \`)([^']+?)((?:'|\&\#39;))}
- {$1.q(<a href=").html_escape(pkg_url(pkg=>$2)).qq(">$2</a>).$3.q(<a href=").html_escape(pkg_url(pkg=>$4)).qq(">$4</a>).$5}eo;
+ {$1.q(<a href=").html_escape(package_links(package=>$2)).qq(">$2</a>).$3.q(<a href=").html_escape(package_links(package=>$4)).qq(">$4</a>).$5}eo;
if (defined $time) {
$output .= ' ('.strftime('%a, %d %b %Y %T GMT',gmtime($time)).') ';
}
test:
$(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
+testcover:
+ PERLLIB=t/cover_lib/ cover -test
+
clean:
if [ -e Makefile.perl ]; then \
$(MAKE) -f Makefile.perl clean; \
* Hack around elinks css bug (closes: #593804)
* affects now appends packages by default (closes: #656371). Thanks to
Andreas Beckmann and Julien Cristau.
+ * Fix spacing in owner block (closes: #670411)
+ [Thanks to Arnout Engelen: ]
+ * Add Homepage (closes: #670555).
+ * Fix VCS in control (closes: #670556).
+ * Link to blocked bugs (closes: #670568).
+
-- Don Armstrong <don@debian.org> Wed, 25 Aug 2010 01:57:38 -0700
debbugs (2.4.2~exp1) experimental; urgency=low
Maintainer: Debbugs developers <debian-debbugs@lists.debian.org>
Uploaders: Colin Watson <cjwatson@debian.org>, Don Armstrong <don@debian.org>
Standards-Version: 3.8.2
-Vcs-Bzr: http://bugs.debian.org/debbugs-source/mainline
Vcs-Browser: http://bugs.debian.org/debbugs-source/mainline
+Vcs-Git: http://bugs.debian.org/debbugs-source/debbugs.git
Build-Depends: debhelper (>= 5)
Build-Depends-Indep: libparams-validate-perl,
libmailtools-perl, libmime-tools-perl, libio-stringy-perl, libmldbm-perl,
libmail-rfc822-address-perl, libsafe-hole-perl, libuser-perl,
libconfig-simple-perl, libtest-pod-perl, liblist-moreutils-perl,
libtext-template-perl
+Homepage: http://wiki.debian.org/Teams/Debbugs
Package: debbugs
Architecture: all
# -*- mode: cperl;-*-
-use Test::More tests => 14;
+use Test::More tests => 20;
use warnings;
use strict;
use lib qw(t/lib);
use DebbugsTest qw(:all);
use Data::Dumper;
+use Test::WWW::Mechanize;
# HTTP::Server:::Simple defines a SIG{CHLD} handler that breaks system; undef it here.
$SIG{CHLD} = sub {};
$status = read_bug(bug=>3);
ok($status->{blockedby} eq '5','bug 3 is blocked by exactly 5');
+
+# Check how this blocked bug is presented on the web interface
+
+# start up an HTTP::Server::Simple
+my $bugreport_cgi_handler = sub {
+ # I do not understand why this is necessary.
+ $ENV{DEBBUGS_CONFIG_FILE} = "$config{config_dir}/debbugs_config";
+ my $content = qx(perl -I. -T cgi/bugreport.cgi);
+ $content =~ s/^\s*Content-Type:[^\n]+\n*//si;
+ print $content;
+};
+
+my $port = 11342;
+
+ok(DebbugsTest::HTTPServer::fork_and_create_webserver($bugreport_cgi_handler,$port),
+ 'forked HTTP::Server::Simple successfully');
+
+my $mech = Test::WWW::Mechanize->new();
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=10',
+ 'Page received ok');
+
+ok($mech->content() =~ qr//i,
+ 'Title of bug is \'Submitting a bug\'');
+
+ok($mech->content() =~ qr/Added blocking bug\(s\) of <a[^>]+10[^>]+>10<\/a>: <a[^>]+2[^>]+>2<\/a>/i,
+ '\'Added blocking bug(s) of x: y\' received markup');
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=2',
+ 'Page received ok');
+
+ok($mech->content() =~ qr/Added indication that bug <a[^>]+2[^>]+>2<\/a> blocks <a[^>]+10[^>]+>10<\/a>/i,
+ '\'indication that bug x blocks y\' received markup');
--- /dev/null
+# this is a tiny module which basically provides a fake safe for use with Devel::Cover
+package Safe;
+
+sub new {
+ my $class = shift;
+ my $self = {root => 'fakeSafe'};
+ bless ($self,$class);
+ return $self;
+}
+
+sub permit {
+}
+
+sub reval {
+ my ($self,$code) = @_;
+ eval "package $self->{root}; $code";
+}
+
+sub root {
+ my ($self) = @_;
+ return($self->{root});
+}
+
+sub varglob {
+ my ($self,$var) = @_;
+ no strict 'refs';
+ no warnings 'once';
+ return *{$self->{root}."::$var"};
+}
+
+1;
<span>Date: {$status{date_text}};</span>
{ my $output = '';
if (defined $status{owner} and length $status{owner}) {
- $output = q(<span>Owned by: ).package_links(owner=>$status{owner}).q(;</span>);
+ $output = q(<span>Owned by: ).package_links(owner=>$status{owner}).qq(;</span>\n);
}
$output;
}<span>Severity: {my $output = $status{severity};