diff --git a/Changes b/Changes index 1b2018b..dc8ce23 100644 --- a/Changes +++ b/Changes @@ -4,6 +4,8 @@ Revision history for Perl extension SVN::Notify - Fixed a typo, thanks to gregor herrmann of the Debian project. - Eliminated "Unescaped left brace in regex is deprecated" warnings on Perl 5.21. + - Fixed test failures triggered by an improvement to the encoding of + headers by the Encode module. Thanks to Pali for the fix! 2.84 2013-08-13T14:25:21Z - Added `--smtp-tls` to the output of `man svnnotify`. diff --git a/t/base.t b/t/base.t index b46ca99..48c02b1 100644 --- a/t/base.t +++ b/t/base.t @@ -23,9 +23,9 @@ my $subj = "Did this, that, and the «other»."; my $qsubj; if (SVN::Notify::PERL58()) { $subj = Encode::decode_utf8( $subj ); - $qsubj = quotemeta Encode::encode( 'MIME-Q', '[111] ' . $subj ); + $qsubj = quotemeta Encode::encode( 'MIME-Q', "[111] $subj" ); } else { - $qsubj = quotemeta $subj; + $qsubj = quotemeta "[111] $subj"; } ############################################################################## diff --git a/t/filter.t b/t/filter.t index 3044bcb..83563e2 100644 --- a/t/filter.t +++ b/t/filter.t @@ -30,9 +30,9 @@ my $subj = "DId thIs, thAt, And thE «OthEr»."; my $qsubj; if (SVN::Notify::PERL58()) { Encode::_utf8_on( $subj ); - $qsubj = quotemeta Encode::encode( 'MIME-Q', $subj ); + $qsubj = quotemeta Encode::encode( 'MIME-Q', "[111] $subj" ); } else { - $qsubj = quotemeta $subj; + $qsubj = quotemeta "[111] $subj"; } ############################################################################## @@ -81,7 +81,7 @@ ok $notifier->prepare, 'Prepare recipients filter checking'; ok $notifier->execute, 'Notify recipients_mesage filter checking'; like $email, qr/^To: tEst[@]ExAmplE[.]cOm/m, 'The recipient should be modified'; like $email, qr/From: thEOry/m, 'The From header should be modified'; -like $email, qr/Subject: \[111\] $qsubj/m, 'The Subject should be modified'; +like $email, qr/Subject: $qsubj/m, 'The Subject should be modified'; ############################################################################## # Metadata filter. diff --git a/t/html.t b/t/html.t index 79b5cfe..2a99b6a 100644 --- a/t/html.t +++ b/t/html.t @@ -30,9 +30,9 @@ my $subj = "Did this, that, and the «other»."; my $qsubj; if (SVN::Notify::PERL58()) { Encode::_utf8_on( $subj ); - $qsubj = quotemeta Encode::encode( 'MIME-Q', $subj ); + $qsubj = quotemeta Encode::encode( 'MIME-Q', "[111] $subj" ); } else { - $qsubj = quotemeta $subj; + $qsubj = quotemeta "[111] $subj"; } ############################################################################## @@ -59,7 +59,7 @@ ok( $notifier->execute, "HTML notify" ); my $email = get_output(); # Check the email headers. -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML subject' ); like( $email, qr/From: theory\n/, 'Check HTML From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML To'); like( $email, qr{Content-Type: text/html; charset=UTF-8\n}, @@ -133,7 +133,7 @@ ok( $notifier->execute, "HTML notify" ); $email = get_output(); # Check the email headers. -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML subject' ); like( $email, qr/From: theory\n/, 'Check HTML From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML To'); like( $email, qr{Content-Type: text/html; charset=UTF-8\n}, @@ -159,7 +159,7 @@ NO_BADLANG: { # Get the output. $email = get_output(); -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML subject' ); like( $email, qr/From: theory\n/, 'Check HTML diff From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML diff To'); @@ -214,7 +214,7 @@ ok( $notifier->execute, "Attach HTML attach diff notify" ); # Get the output. $email = get_output(); -like( $email, qr/Subject: \[111\] $qsubj\n/, +like( $email, qr/Subject: $qsubj\n/, "Check HTML attach diff subject" ); like( $email, qr/From: theory\n/, 'Check HTML attach diff From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML attach diff To'); diff --git a/t/htmlcolordiff.t b/t/htmlcolordiff.t index 807b9f1..0762525 100644 --- a/t/htmlcolordiff.t +++ b/t/htmlcolordiff.t @@ -29,9 +29,9 @@ my $subj = "Did this, that, and the «other»."; my $qsubj; if (SVN::Notify::PERL58()) { Encode::_utf8_on( $subj ); - $qsubj = quotemeta Encode::encode( 'MIME-Q', $subj ); + $qsubj = quotemeta Encode::encode( 'MIME-Q', "[111] $subj" ); } else { - $qsubj = quotemeta $subj; + $qsubj = quotemeta "[111] $subj"; } ############################################################################## @@ -49,7 +49,7 @@ ok( $notifier->execute, "HTML notify" ); my $email = get_output(); # Check the email headers. -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML subject' ); like( $email, qr/From: theory\n/, 'Check HTML From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML To'); like( $email, qr{Content-Type: text/html; charset=UTF-8\n}, @@ -119,7 +119,7 @@ ok( $notifier->execute, "HTML notify" ); $email = get_output(); # Check the email headers. -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML subject' ); like( $email, qr/From: theory\n/, 'Check HTML From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML To'); like( $email, qr{Content-Type: text/html; charset=UTF-8\n}, @@ -140,7 +140,7 @@ ok( $notifier->execute, "HTML diff notify" ); # Get the output. $email = get_output(); -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML diff subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML diff subject' ); like( $email, qr/From: theory\n/, 'Check HTML diff From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML diff To'); @@ -219,7 +219,7 @@ ok( $notifier->execute, "Attach HTML attach diff notify" ); # Get the output. $email = get_output(); -like( $email, qr/Subject: \[111\] $qsubj\n/, 'Check HTML attach diff subject' ); +like( $email, qr/Subject: $qsubj\n/, 'Check HTML attach diff subject' ); like( $email, qr/From: theory\n/, 'Check HTML attach diff From'); like( $email, qr/To: test\@example\.com\n/, 'Check HTML attach diff To'); diff --git a/t/smtp.t b/t/smtp.t index d46f19d..08b769e 100644 --- a/t/smtp.t +++ b/t/smtp.t @@ -25,9 +25,9 @@ my $subj = "Did this, that, and the «other»."; my $qsubj; if (SVN::Notify::PERL58()) { Encode::_utf8_on( $subj ); - $qsubj = quotemeta Encode::encode( 'MIME-Q', $subj ); + $qsubj = quotemeta Encode::encode( 'MIME-Q', "[111] $subj" ); } else { - $qsubj = quotemeta $subj; + $qsubj = quotemeta "[111] $subj"; } ############################################################################## @@ -52,7 +52,7 @@ ok $smtp->{data}, 'data() should have been called'; ok $smtp->{dataend}, 'dataend() should have been called'; ok $smtp->{quit}, 'quit() should have been called'; -like $smtp->{datasend}, qr/Subject: \[111\] $qsubj\n/, 'Check subject'; +like $smtp->{datasend}, qr/Subject: $qsubj\n/, 'Check subject'; like $smtp->{datasend}, qr/From: theory\n/, 'Check From'; like $smtp->{datasend}, qr/To:\s+test\@example\.com,\s+try\@example\.com\n/, 'Check To';