From a00b7214f767191580455b3895e6186c2a72febb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 31 Mar 2021 03:29:47 +0500 Subject: lei: fix IMAP auth failure handling We must use the $ops hashref returned by lei->workers_start, since it's modified to include extra handlers for auth failures and whatnot. Fixes: 954581b8e575966a ("lei: simplify PktOp callers") --- xt/lei-auth-fail.t | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'xt') diff --git a/xt/lei-auth-fail.t b/xt/lei-auth-fail.t index 78f8466d..e352aab3 100644 --- a/xt/lei-auth-fail.t +++ b/xt/lei-auth-fail.t @@ -9,13 +9,12 @@ require_mods(qw(Mail::IMAPClient)); my $imap_fail = $ENV{TEST_LEI_IMAP_FAIL_URL} // 'imaps://AzureDiamond:Hunter2@public-inbox.org:994/INBOX'; test_lei(sub { - ok(!lei(qw(convert -o mboxrd:/dev/stdout), $imap_fail), - 'IMAP auth failure on convert'); - like($lei_err, qr!\bE:.*?imaps://.*?!sm, 'error shown'); - unlike($lei_err, qr!Hunter2!s, 'password not shown'); - is($lei_out, '', 'nothing output'); - ok(!lei(qw(import), $imap_fail), 'IMAP auth failure on import'); - like($lei_err, qr!\bE:.*?imaps://.*?!sm, 'error shown'); - unlike($lei_err, qr!Hunter2!s, 'password not shown'); + for my $pfx ([qw(convert -o mboxrd:/dev/stdout)], ['import'], + [qw(tag +L:INBOX)]) { + ok(!lei(@$pfx, $imap_fail), "IMAP auth failure on @$pfx"); + like($lei_err, qr!\bE:.*?imaps://.*?!sm, 'error shown'); + unlike($lei_err, qr!Hunter2!s, 'password not shown'); + is($lei_out, '', 'nothing output'); + } }); done_testing; -- cgit v1.2.3-24-ge0c7