]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: consistent ordering of Cc: addresses
authorEric Wong <e@80x24.org>
Wed, 12 Aug 2015 22:41:10 +0000 (22:41 +0000)
committerEric Wong <e@80x24.org>
Wed, 12 Aug 2015 22:41:42 +0000 (22:41 +0000)
This fixes a minor test failure in t/cgi.t

Tested with perl 5.18.2-2ubuntu1 on Ubuntu 14.04.3 LTS

lib/PublicInbox/View.pm
t/cgi.t

index c0f3e9f94e00ab0c811c28ade68d397ec4e24d8e..30759a308bd1c13693e9104362ba9831e85208ca 100644 (file)
@@ -349,7 +349,7 @@ sub html_footer {
        $to = uri_escape_utf8($to);
        $subj = uri_escape_utf8($subj);
 
-       my $cc = uri_escape_utf8(join(',', values %cc));
+       my $cc = uri_escape_utf8(join(',', sort values %cc));
        my $href = "mailto:$to?In-Reply-To=$irp&Cc=${cc}&Subject=$subj";
 
        my $idx = $standalone ? " <a\nhref=\"../\">index</a>" : '';
diff --git a/t/cgi.t b/t/cgi.t
index b59ca54ae15e6d96ea4683e691cd8b5256caf798..a16ebd8daa5485f57eb3b3647655f23794fd2506 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -120,7 +120,9 @@ EOF
        like($res->{head}, qr/Status: 200 OK/, "index returns 200");
 
        my $idx = cgi_run("/test/index.html");
-       $idx->{body} =~ s!/index.html(\?r=)!/$1!; # dirty...
+       $idx->{body} =~ s!/index.html(\?r=)!/$1!g; # dirty...
+       $idx->{body} = [ split(/\n/, $idx->{body}) ];
+       $res->{body} = [ split(/\n/, $res->{body}) ];
        is_deeply($res, $idx,
                '/$LISTNAME/ and /$LISTNAME/index.html are nearly identical');
        # more checks in t/feed.t