# -*- mode: cperl;-*-
-use Test::More tests => 18;
+use Test::More tests => 22;
use warnings;
use strict;
use lib qw(t/lib);
use DebbugsTest qw(:all);
-my %config;
-eval {
- %config = create_debbugs_configuration();
-};
-if ($@) {
- BAIL_OUT($@);
-}
+my %config = create_debbugs_configuration();
+
# create a bug
send_message(to=>'submit@bugs.something',
Package: foo
Severity: normal
-This is a silly bug
+This is a silly bug which contains an unescaped From line.
+
+From line
EOF
'Subject of bug maibox is right');
ok($mech->content() =~ qr/^From /m,
'Starts with a From appropriately');
+ok($mech->content() =~ qr/^(>F|=46)rom line/m,
+ 'From line escaped appropriately');
$mech->get_ok('http://localhost:'.$port.'/?bug=1;mboxmaint=yes',
'Page received ok');
}
# Other tests for bugs in the page should be added here eventually
+send_message(to => '1@bugs.something',
+ headers => [To => '1@bugs.something',
+ From => 'foo@bugs.something',
+ Subject => "Message with some links to linkify",
+ ],
+ body => <<EOF) or fail 'message to 1@bugs.something failed';
+This is a test message.
+
+This is a link https://example.com/foo; which should not include the ;
+
+
+This is a link https://example.com/foo;bar which should include the ;
+EOF
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=1',
+ 'Page received ok');
+like($mech->content(), qr(href="https://example.com/foo;bar"),
+ 'Link includes ; correctly');
+like($mech->content(), qr(href="https://example.com/foo"),
+ 'Link excludes trailing ;');