diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-03 04:00:09 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-03 06:47:14 +0000 |
commit | 3f2d9e30255824da52bca422d07e97e0859500e2 (patch) | |
tree | ec2eac56c92649b696a5b2ebaa1067867a53c684 /t/v2writable.t | |
parent | 44ff716b116f10ae42372f9f517356000636e571 (diff) | |
download | public-inbox-3f2d9e30255824da52bca422d07e97e0859500e2.tar.gz |
It's possible to have a message handle multiple terms; so use this feature to ensure messages with multiple MIDs can be found by either one.
Diffstat (limited to 't/v2writable.t')
-rw-r--r-- | t/v2writable.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/v2writable.t b/t/v2writable.t index bc2437a8..44191c13 100644 --- a/t/v2writable.t +++ b/t/v2writable.t @@ -80,5 +80,18 @@ ok($im->add($mime), 'ordinary message added'); is(scalar(@mids), 1, 'new generated'); } -$im->done; +{ + $mime->header_set('Message-Id', '<abcde@1>', '<abcde@2>'); + ok($im->add($mime), 'message with multiple Message-ID'); + $im->done; + my @found; + $ibx->search->each_smsg_by_mid('abcde@1', sub { push @found, @_; 1 }); + is(scalar(@found), 1, 'message found by first MID'); + $ibx->search->each_smsg_by_mid('abcde@2', sub { push @found, @_; 1 }); + is(scalar(@found), 2, 'message found by second MID'); + is($found[0]->{doc_id}, $found[1]->{doc_id}, 'same document'); + ok($found[1]->{doc_id} > 0, 'doc_id is positive'); +} + + done_testing(); |