]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/reply.t
over*: use v5.10.1, drop warnings
[public-inbox.git] / t / reply.t
index 640069cb8cc5b4e961d216dc3b22b54425489cca..53162df5d2566be1097745890cac339d6e866124 100644 (file)
--- a/t/reply.t
+++ b/t/reply.t
@@ -1,9 +1,9 @@
-# Copyright (C) 2017 all contributors <meta@public-inbox.org>
+# Copyright (C) 2017-2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
-use Email::MIME;
+use PublicInbox::Eml;
 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::Eml->new(<<'EOF');
 From: from <from@example.com>
 To: to <to@example.com>
 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();