X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Freply.t;h=7319e2337dd18b95ab3c623b995ef25f8e037bd4;hb=bedc22c355d570ed07ff6600717a97226f791ff5;hp=719b4e47565f06d3365ae43562e3c4ffcf657e4a;hpb=666844ae42b5b17fd2e9b7ea6cf04727487b5322;p=public-inbox.git
diff --git a/t/reply.t b/t/reply.t
index 719b4e47..7319e233 100644
--- a/t/reply.t
+++ b/t/reply.t
@@ -1,9 +1,10 @@
-# Copyright (C) 2017 all contributors
+#!perl -w
+# Copyright (C) 2017-2021 all contributors
# License: AGPL-3+
use strict;
-use warnings;
use Test::More;
-use Email::MIME;
+use PublicInbox::Config;
+use PublicInbox::Eml;
use_ok 'PublicInbox::Reply';
my @q = (
@@ -15,11 +16,11 @@ my @q = (
while (@q) {
my $input = shift @q;
my $expect = shift @q;
- my $res = PublicInbox::Reply::squote_maybe($input);
+ my $res = PublicInbox::Config::squote_maybe($input);
is($res, $expect, "quote $input => $res");
}
-my $mime = Email::MIME->new(<<'EOF');
+my $mime = PublicInbox::Eml->new(<<'EOF');
From: from
To: to
Cc: cc@example.com
@@ -36,7 +37,7 @@ my $exp = [
'--in-reply-to=blah@example.com',
'--to=from@example.com',
'--cc=cc@example.com',
- '--cc=to@example.com'
+ '--cc=to@example.com',
];
is_deeply($arg, $exp, 'default reply is to :all');
@@ -53,7 +54,7 @@ $exp = [
'--in-reply-to=blah@example.com',
'--to=primary@example.com',
'--cc=cc@example.com',
- '--cc=to@example.com'
+ '--cc=to@example.com',
];
$ibx->{replyto} = ':list,Cc,To';
($arg, $link) = PublicInbox::Reply::mailto_arg_link($ibx, $hdr);
@@ -71,9 +72,14 @@ $exp = [
'--in-reply-to=blah@example.com',
'--to=from@example$(echo .)com',
'--cc=cc@example$(echo .)com',
- '--cc=to@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();