From 90155b72ccd38d51415f12547e39c4d65c469fe1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 29 Apr 2021 09:46:19 +0000 Subject: lei import: support UIDVALIDITY in IMAP URL Specifying a UIDVALIDITY value allows the user to enforce a strict match and force failure. This necessitated changes to NetReader to allow die() and make error reporting more suitable for CLI usage rather than daemonized usage of -watch. --- t/lei-import-imap.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't') diff --git a/t/lei-import-imap.t b/t/lei-import-imap.t index 611328b4..c977c68e 100644 --- a/t/lei-import-imap.t +++ b/t/lei-import-imap.t @@ -24,6 +24,10 @@ test_lei({ tmpdir => $tmpdir }, sub { lei_ok('import', $url); lei_ok 'ls-sync'; like($lei_out, qr!\A\Q$url\E;UIDVALIDITY=\d+\n\z!, 'ls-sync'); + chomp(my $u = $lei_out); + lei_ok('import', $u, \'UIDVALIDITY match in URL'); + $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s; + ok(!lei('import', $u), 'UIDVALIDITY mismatch in URL rejected'); lei_ok('inspect', $url); my $inspect = json_utf8->decode($lei_out); -- cgit v1.2.3-24-ge0c7