]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei_to_mail.t
lei import: add IMAP and (maildir|mbox*):$PATHNAME support
[public-inbox.git] / t / lei_to_mail.t
index 6a571660d6861350787444d0615a19123070e54a..72b9070097a024fb282f94fc1e2b3e830020ae1c 100644 (file)
@@ -139,6 +139,16 @@ test_lei(sub {
        is($res->[1], undef, 'only one result');
 });
 
+test_lei(sub {
+       lei_ok('import', "$mbox:$fn", \'imported mbox:/path') or diag $lei_err;
+       lei_ok(qw(q s:x), \'lei q works') or diag $lei_err;
+       my $res = json_utf8->decode($lei_out);
+       my $x = $res->[0];
+       is($x->{'s'}, 'x', 'subject imported') or diag $lei_out;
+       is_deeply($x->{'kw'}, ['seen'], 'kw imported') or diag $lei_out;
+       is($res->[1], undef, 'only one result');
+});
+
 for my $zsfx (qw(gz bz2 xz)) { # XXX should we support zst, zz, lzo, lzma?
        my $zsfx2cmd = PublicInbox::LeiToMail->can('zsfx2cmd');
        SKIP: {