X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Freply.t;h=a6c38cfaaf2ba97cc4929994b930fbc2bab553cd;hb=e6b7a7f5f70fb89a54ff158bc6c8b564149947e5;hp=640069cb8cc5b4e961d216dc3b22b54425489cca;hpb=ef3ca9b80fcb464d851c2f8d87f3f02f4f70986d;p=public-inbox.git
diff --git a/t/reply.t b/t/reply.t
index 640069cb..a6c38cfa 100644
--- a/t/reply.t
+++ b/t/reply.t
@@ -1,9 +1,9 @@
-# Copyright (C) 2017 all contributors
+# Copyright (C) 2017-2020 all contributors
# License: AGPL-3+
use strict;
use warnings;
use Test::More;
-use Email::MIME;
+use PublicInbox::MIME;
use_ok 'PublicInbox::Reply';
my @q = (
@@ -19,7 +19,7 @@ while (@q) {
is($res, $expect, "quote $input => $res");
}
-my $mime = Email::MIME->new(<<'EOF');
+my $mime = PublicInbox::MIME->new(<<'EOF');
From: from
To: to
Cc: cc@example.com
@@ -64,4 +64,21 @@ $ibx->{replyto} = 'new@example.com';
$exp = [ '--in-reply-to=blah@example.com', '--to=new@example.com' ];
is_deeply($arg, $exp, 'explicit address works, too');
+$ibx->{replyto} = ':all';
+$ibx->{obfuscate} = 1;
+($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
+$exp = [
+ '--in-reply-to=blah@example.com',
+ '--to=from@example$(echo .)com',
+ '--cc=cc@example$(echo .)com',
+ '--cc=to@example$(echo .)com'
+];
+is_deeply($arg, $exp, 'address obfuscation works');
+is($link, '', 'no mailto: link given');
+
+$ibx->{replyto} = ':none=dead list';
+$ibx->{obfuscate} = 1;
+($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
+is($$arg, 'dead list', ':none= works');
+
done_testing();