diff options
author | Eric Wong <e@80x24.org> | 2021-02-04 00:59:30 -0900 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-02-05 00:16:35 +0000 |
commit | e3c82310f5df24a42a0dc3c08b97b409a185b3a3 (patch) | |
tree | 4eae3ed784094b6315ba9377748237f6ec420e93 /t/lei.t | |
parent | 10416197f0ca68d3a0d6034b46593b71d1e5b128 (diff) | |
download | public-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.t | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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}) { |