about summary refs log tree commit homepage
path: root/t/import.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-24 01:15:16 +0000
committerEric Wong <e@80x24.org>2016-06-24 07:03:47 +0000
commit40782735e74e427997b5b900d60cc07597e330c3 (patch)
treec2131a869e83df2173eda00cdfee988d48594b67 /t/import.t
parentf881729b5654a707cbc22dd0a386b3cbdff68d83 (diff)
downloadpublic-inbox-40782735e74e427997b5b900d60cc07597e330c3.tar.gz
Mailing lists I watch and mirror may not have the best spam
filtering, and an extra layer should not hurt.
Diffstat (limited to 't/import.t')
-rw-r--r--t/import.t6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/import.t b/t/import.t
index 09c00362..73f92adb 100644
--- a/t/import.t
+++ b/t/import.t
@@ -30,7 +30,7 @@ is(scalar @revs, 1, 'one revision created');
 
 $mime->header_set('Message-ID', '<b@example.com>');
 $mime->header_set('Subject', 'msg2');
-like($im->add($mime), qr/\A:\d+\z/, 'added 2nd message');
+like($im->add($mime, sub { $mime }), qr/\A:\d+\z/, 'added 2nd message');
 $im->done;
 @revs = $git->qx(qw(rev-list HEAD));
 is(scalar @revs, 2, '2 revisions exist');
@@ -61,5 +61,9 @@ is($mark, 'MISMATCH', 'mark == MISMATCH on mismatch');
 is($msg->header('Message-ID'), '<a@example.com>', 'Message-ID matches');
 isnt($msg->header('Subject'), $mime->header('Subject'), 'subject mismatch');
 
+$mime->header_set('Message-Id', '<failcheck@example.com>');
+is($im->add($mime, sub { undef }), undef, 'check callback fails');
+is($im->remove($mime), undef, 'message not added, so not removed');
+
 $im->done;
 done_testing();