diff options
author | Eric Wong <e@80x24.org> | 2021-09-16 20:56:43 -0500 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-17 04:41:06 +0000 |
commit | a6b2025c0ac0e9619dbe164c1b28a35bf25576a3 (patch) | |
tree | 8b967e20866a0e4c84584b24e2860095349fb585 /t | |
parent | 76d110573f75d577228217eab44477dcc691116e (diff) | |
download | public-inbox-a6b2025c0ac0e9619dbe164c1b28a35bf25576a3.tar.gz |
There's no point in keeping mail_sync.sqlite3 entries around if the folder is gone. We do keep saved-search configs around, however, since somebody may decide to blow away a search and start over.
Diffstat (limited to 't')
-rw-r--r-- | t/lei-refresh-mail-sync.t | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/lei-refresh-mail-sync.t b/t/lei-refresh-mail-sync.t index ff558277..d3438011 100644 --- a/t/lei-refresh-mail-sync.t +++ b/t/lei-refresh-mail-sync.t @@ -3,6 +3,7 @@ # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> use strict; use v5.10.1; use PublicInbox::TestCommon; require_mods(qw(lei)); +use File::Path qw(remove_tree); my $stop_daemon = sub { # needed since we don't have inotify lei_ok qw(daemon-pid); @@ -62,6 +63,15 @@ test_lei({ daemon_only => 1 }, sub { lei_ok 'inspect', "blob:$oid"; is_deeply(json_utf8->decode($lei_out), $exp1, 'replaced file noted again'); + + $stop_daemon->(); + + remove_tree($d); + lei_ok 'refresh-mail-sync', '--all'; + lei_ok 'inspect', "blob:$oid"; + is($lei_out, '{}', 'no known locations after "removal"'); + lei_ok 'ls-mail-sync'; + is($lei_out, '', 'no sync left when folder is gone'); }); done_testing; |