about summary refs log tree commit homepage
path: root/t/lei.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-04 00:59:30 -0900
committerEric Wong <e@80x24.org>2021-02-05 00:16:35 +0000
commite3c82310f5df24a42a0dc3c08b97b409a185b3a3 (patch)
tree4eae3ed784094b6315ba9377748237f6ec420e93 /t/lei.t
parent10416197f0ca68d3a0d6034b46593b71d1e5b128 (diff)
downloadpublic-inbox-e3c82310f5df24a42a0dc3c08b97b409a185b3a3.tar.gz
Only tested with .eml files so far, but Maildir + IMAP
will be supported.
Diffstat (limited to 't/lei.t')
-rw-r--r--t/lei.t15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/lei.t b/t/lei.t
index a08a6d0d..eb824a30 100644
--- a/t/lei.t
+++ b/t/lei.t
@@ -389,6 +389,20 @@ SKIP: {
 }; # /SKIP
 };
 
+my $test_import = sub {
+        $cleanup->();
+        ok($lei->(qw(q s:boolean)), 'search miss before import');
+        unlike($out, qr/boolean/i, 'no results, yet');
+        open my $fh, '<', 't/data/0001.patch' or BAIL_OUT $!;
+        ok($lei->([qw(import -f eml -)], undef, { %$opt, 0 => $fh }),
+                'import single file from stdin');
+        close $fh;
+        ok($lei->(qw(q s:boolean)), 'search hit after import');
+        ok($lei->(qw(import -f eml), 't/data/message_embed.eml'),
+                'import single file by path');
+        $cleanup->();
+};
+
 my $test_lei_common = sub {
         $test_help->();
         $test_config->();
@@ -396,6 +410,7 @@ my $test_lei_common = sub {
         $test_external->();
         $test_completion->();
         $test_fail->();
+        $test_import->();
 };
 
 if ($ENV{TEST_LEI_ONESHOT}) {