]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/lei-import-imap: bail on missing UIDVALIDITY after import
authorEric Wong <e@80x24.org>
Thu, 26 Sep 2024 10:56:35 +0000 (10:56 +0000)
committerEric Wong <e@80x24.org>
Mon, 30 Sep 2024 10:59:44 +0000 (10:59 +0000)
I haven't been able to reproduce it, but I've seen the test
fail because ls-mail-sync didn't emit anything which matched
/;UIDVALIDITY=(\d+)\s*/.  Add some diagnostics and bail out
right away if it happens again.

t/lei-import-imap.t

index 3b6cb29926eee322355365631ff636c3d261eb3b..a835e82f3695c554cdbc96bc4fee4d3dac11bafb 100644 (file)
@@ -39,9 +39,10 @@ test_lei({ tmpdir => $tmpdir }, sub {
        lei_ok 'ls-mail-sync';
        like($lei_out, qr!$re\n\z!, 'ls-mail-sync');
        chomp(my $u = $lei_out);
-       lei_ok('import', $u, \'UIDVALIDITY match in URL');
        $url = $u;
-       $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s;
+       $u =~ s/;UIDVALIDITY=(\d+)\s*/;UIDVALIDITY=9$1/s or
+               xbail 'no UIDVALIDITY=\\d+ in URL=', \$u, 'lei_out=', \$lei_out;
+       lei_ok('import', $url, \'UIDVALIDITY match in URL');
        ok(!lei('import', $u), 'UIDVALIDITY mismatch in URL rejected');
        like($lei_err, qr/UIDVALIDITY mismatch/, 'mismatch noted');