X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2F13_utf8_mail.t;h=7ef4aaffdc98c393d97f5a130a41bf8b52c5d906;hb=4c244879af2b9e8c0055968d7ffb054646cb7607;hp=2491e14c3b1f67a3382369b0d8bf0e2f2a443184;hpb=4a33202f6e53ef347c9c1b5565d8902c4bc60fee;p=debbugs.git diff --git a/t/13_utf8_mail.t b/t/13_utf8_mail.t index 2491e14..7ef4aaf 100644 --- a/t/13_utf8_mail.t +++ b/t/13_utf8_mail.t @@ -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 => 12; +use Test::More tests => 13; use warnings; use strict; @@ -24,7 +24,7 @@ use File::Basename qw(dirname basename); use lib qw(t/lib); use DebbugsTest qw(:all); use Data::Dumper; -use Encode qw(decode encode decode_utf8); +use Encode qw(decode encode decode_utf8 encode_utf8); # HTTP::Server:::Simple defines a SIG{CHLD} handler that breaks system; undef it here. $SIG{CHLD} = sub {}; @@ -53,10 +53,10 @@ END{ send_message(to=>'submit@bugs.something', headers => [To => 'submit@bugs.something', - From => 'foo@bugs.something', + From => 'föoff@bugs.something', Subject => 'Submiting a bug', ], - body => < [{Type=>"text/plain",Charset=>"utf-8",Data=>< < [{Type=>"text/plain",Charset=>"utf-8",Data=>encode_utf8(< '1@bugs.something', headers => [To => '1@bugs.something', - From => 'foo@bugs.something', + From => 'föoff@bugs.something', Subject => 'Sending a message to a bug', ], body => < 'control@bugs.something', headers => [To => 'control@bugs.something', - From => 'foo@bugs.something', + From => 'föoff@bugs.something', Subject => 'Munging a bug', ], body => <{subject} eq 'ü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'); - +ok(system('sh','-c',encode_utf8('grep -q "föoff@bugs.something" '.$spool_dir.'/index.db'))==0, + 'index.db not double escaped');