X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=t%2F13_utf8_mail.t;h=b98154e9f015cc16e19b6f900ddaf603799c635f;hb=1b1562614656acf70e9b69c8eb736673f370c816;hp=4eda888df35cd0b67dbd0a8f5776342317d9f7f4;hpb=23d26116c0fcfeeaf60a7ab724f18fe86554d746;p=debbugs.git diff --git a/t/13_utf8_mail.t b/t/13_utf8_mail.t index 4eda888..b98154e 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,39 +24,28 @@ 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 {}; -my %config; -eval { - %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0); -}; -if ($@) { - BAIL_OUT($@); -} +my %config = create_debbugs_configuration(); + my $sendmail_dir = $config{sendmail_dir}; my $spool_dir = $config{spool_dir}; my $config_dir = $config{config_dir}; -END{ - if ($ENV{DEBUG}) { - diag("spool_dir: $spool_dir\n"); - diag("config_dir: $config_dir\n"); - diag("sendmail_dir: $sendmail_dir\n"); - } -} + # We're going to use create mime message to create these messages, and # then just send them to receive. 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(<{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');