diff options
author | Eric Wong <e@yhbt.net> | 2020-06-27 10:03:51 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-06-28 22:27:27 +0000 |
commit | 204e451851dfe510e16cc03e4a6ea6242c4e9076 (patch) | |
tree | 344ad4b7e66ab02188071dcd5d09a7cd96f89b51 /t | |
parent | 62e3ea11522242c651ea4991712f040ab460223d (diff) | |
download | public-inbox-204e451851dfe510e16cc03e4a6ea6242c4e9076.tar.gz |
Since we store all watched directory names as keys in %mdmap, there should be no need to keep an array of those directories around. t/watch_maildir*.t required changes to remove trained spam. Once we've trained something as spam, there shouldn't be a need to rescan it.
Diffstat (limited to 't')
-rw-r--r-- | t/watch_maildir.t | 2 | ||||
-rw-r--r-- | t/watch_maildir_v2.t | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/t/watch_maildir.t b/t/watch_maildir.t index c8658140..c44273f0 100644 --- a/t/watch_maildir.t +++ b/t/watch_maildir.t @@ -84,6 +84,7 @@ PublicInbox::WatchMaildir->new($config)->scan('full'); is(scalar @list, 2, 'two revisions in rev-list'); @list = $git->qx(qw(ls-tree -r --name-only refs/heads/master)); is(scalar @list, 0, 'tree is empty'); +is(unlink(glob("$spamdir/cur/*")), 1, 'unlinked trained spam'); # check with scrubbing { @@ -105,6 +106,7 @@ More majordomo info at http://vger.kernel.org/majordomo-info.html\n); is(scalar @list, 0, 'tree is empty'); @list = $git->qx(qw(rev-list refs/heads/master)); is(scalar @list, 4, 'four revisions in rev-list'); + is(unlink(glob("$spamdir/cur/*")), 1, 'unlinked trained spam'); } { diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t index 6cc8b6ff..f5b8e932 100644 --- a/t/watch_maildir_v2.t +++ b/t/watch_maildir_v2.t @@ -71,6 +71,7 @@ $write_spam->(); is(unlink(glob("$maildir/new/*")), 1, 'unlinked old spam'); PublicInbox::WatchMaildir->new($config)->scan('full'); is(($srch->reopen->query(''))[0], 0, 'deleted file'); +is(unlink(glob("$spamdir/cur/*")), 1, 'unlinked trained spam'); # check with scrubbing { @@ -90,6 +91,7 @@ More majordomo info at http://vger.kernel.org/majordomo-info.html\n); PublicInbox::WatchMaildir->new($config)->scan('full'); ($nr, $msgs) = $srch->reopen->query(''); is($nr, 0, 'inbox is empty again'); + is(unlink(glob("$spamdir/cur/*")), 1, 'unlinked trained spam'); } { |