diff options
author | Eric Wong <e@80x24.org> | 2021-04-03 02:24:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-03 05:08:55 +0000 |
commit | 5b90219609fb672d7bcbb5661305ae9c3a91e4f1 (patch) | |
tree | c8728cfcf6dc3e8e189a5955fad0d0557c803b49 | |
parent | 8325452970650c12c857a9ff858a0bbcb3a34f6d (diff) | |
download | public-inbox-5b90219609fb672d7bcbb5661305ae9c3a91e4f1.tar.gz |
Because failures are often overlooked, unfortunately.
-rw-r--r-- | xt/lei-auth-fail.t | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xt/lei-auth-fail.t b/xt/lei-auth-fail.t index e352aab3..06cb8533 100644 --- a/xt/lei-auth-fail.t +++ b/xt/lei-auth-fail.t @@ -2,17 +2,20 @@ # Copyright (C) 2021 all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> use strict; use v5.10.1; use PublicInbox::TestCommon; -require_mods(qw(Mail::IMAPClient)); +require_mods(qw(Mail::IMAPClient lei)); # TODO: mock IMAP server which fails at authentication so we don't # have to make external connections to test this: my $imap_fail = $ENV{TEST_LEI_IMAP_FAIL_URL} // 'imaps://AzureDiamond:Hunter2@public-inbox.org:994/INBOX'; +my ($ro_home, $cfg_path) = setup_public_inboxes; test_lei(sub { - for my $pfx ([qw(convert -o mboxrd:/dev/stdout)], ['import'], - [qw(tag +L:INBOX)]) { + for my $pfx ([qw(q z:0.. --only), "$ro_home/t1", '-o'], + [qw(convert -o mboxrd:/dev/stdout)], + [qw(convert t/utf8.eml -o), $imap_fail], + ['import'], [qw(tag +L:INBOX)]) { ok(!lei(@$pfx, $imap_fail), "IMAP auth failure on @$pfx"); - like($lei_err, qr!\bE:.*?imaps://.*?!sm, 'error shown'); + like($lei_err, qr!\bE:.*?imaps?://.*?!sm, 'error shown'); unlike($lei_err, qr!Hunter2!s, 'password not shown'); is($lei_out, '', 'nothing output'); } |