diff options
author | Eric Wong <e@80x24.org> | 2021-04-16 16:10:33 -0700 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-17 10:00:45 +0000 |
commit | 02f7fa8f89d63f11e8abc5989ad7a23e31b6f58f (patch) | |
tree | 9f09e6c959d530d36d541b4e318bea886fee891e /t | |
parent | b439514d5bda1e1d134db8ac362834468735ae6a (diff) | |
download | public-inbox-02f7fa8f89d63f11e8abc5989ad7a23e31b6f58f.tar.gz |
Specifying a directory in ~/.local/share/lei/saved-searches/ is painful, so support (and start encouraging) the use of the output.
Diffstat (limited to 't')
-rw-r--r-- | t/lei-q-save.t | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/lei-q-save.t b/t/lei-q-save.t index 6cfac20b..d43f508b 100644 --- a/t/lei-q-save.t +++ b/t/lei-q-save.t @@ -7,6 +7,8 @@ my $doc1 = eml_load('t/plack-qp.eml'); $doc1->header_set('Date', PublicInbox::Smsg::date({ds => time - (86400 * 5)})); my $doc2 = eml_load('t/utf8.eml'); $doc2->header_set('Date', PublicInbox::Smsg::date({ds => time - (86400 * 4)})); +my $doc3 = eml_load('t/msg_iter-order.eml'); +$doc3->header_set('Date', PublicInbox::Smsg::date({ds => time - (86400 * 4)})); test_lei(sub { my $home = $ENV{HOME}; @@ -38,5 +40,14 @@ test_lei(sub { $cfg = PublicInbox::Config->new("$s[0]/lei.saved-search"); is_deeply $cfg->{'lei.q'}, 'd:last.week..', 'q --stdin stores relative time'; + my $size = -s "$home/mbcl2"; + ok(defined($size) && $size > 0, 'results written'); + lei_ok([qw(up mbcl2)], undef, { -C => $home, %$lei_opt }); + is(-s "$home/mbcl2", $size, 'size unchanged on noop up'); + + $in = $doc3->as_string; + lei_ok [qw(import -q -F eml -)], undef, { 0 => \$in, %$lei_opt }; + lei_ok([qw(up mbcl2)], undef, { -C => $home, %$lei_opt }); + ok(-s "$home/mbcl2" > $size, 'size increased after up'); }); done_testing; |