]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/13_utf8_mail.t
test for escaped utf8 bug log
[debbugs.git] / t / 13_utf8_mail.t
index 0157ae92c2fe2683ed6e91b032482d628d6e52e5..8ada76ab01b05a225987cd86c7e8947e357b23ab 100644 (file)
@@ -1,7 +1,7 @@
 # -*- mode: cperl;-*-
 # $Id: 05_mail.t,v 1.1 2005/08/17 21:46:17 don Exp $
 
-use Test::More tests => 11;
+use Test::More tests => 12;
 
 use warnings;
 use strict;
@@ -22,7 +22,7 @@ use File::Basename qw(dirname basename);
 use lib qw(t/lib);
 use DebbugsTest qw(:all);
 use Data::Dumper;
-use Encode qw(decode encode);
+use Encode qw(decode encode decode_utf8);
 
 # HTTP::Server:::Simple defines a SIG{CHLD} handler that breaks system; undef it here.
 $SIG{CHLD} = sub {};
@@ -112,7 +112,7 @@ send_message(to => 'control@bugs.something',
                        ],
             body => <<EOF) or fail 'message to control@bugs.something failed';
 severity 1 wishlist
-retitle 1 new title
+retitle 1 ütff8 title encoding test
 thanks
 EOF
 
@@ -127,5 +127,8 @@ ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: P
 # This is an eval because $ENV{DEBBUGS_CONFIG_FILE} isn't set at BEGIN{} time
 eval "use Debbugs::Status qw(read_bug writebug);";
 my $status = read_bug(bug=>1);
-ok($status->{subject} eq 'new title','bug 1 retitled');
+ok($status->{subject} eq decode_utf8('ütff8 title encoding test'),'bug 1 retitled');
 ok($status->{severity} eq 'wishlist','bug 1 wishlisted');
+ok(system('sh','-c','[ $(egrep "retitle.*encoding test" '.$spool_dir.'/db-h/01/1.log|grep -v "=C3=BCt=EF=AC=808"|wc -l) -eq 0 ]') == 0,
+   'Control messages escaped properly');
+