X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=t%2Fsearch.t;h=13210ff5a4af56e518490fe282c18bc2e8f08af4;hp=47a67f7fb5e94eace65f3bf3d30a68232da7c2fa;hb=8fda04081acde7053458023fde3b1c784cbcfc81;hpb=d0079a334fe2b769e4f81d6bd3c7e4346a8fa2b2 diff --git a/t/search.t b/t/search.t index 47a67f7f..13210ff5 100644 --- a/t/search.t +++ b/t/search.t @@ -533,6 +533,21 @@ $ibx->with_umask(sub { is($query->('s:"mail header experiments"')->[0]->{mid}, '20200418222508.GA13918@dcvr', 'Subject search reaches inside message/rfc822'); + + $doc_id = $rw->add_message(eml_load('t/data/binary.patch')); + $rw->commit_txn_lazy; + $ibx->search->reopen; + my $res = $query->('HcmV'); + is_deeply($res, [], 'no results against trailer'); + $res = $query->('IcmZPo000310RR91'); + is_deeply($res, [], 'no results against 1-byte binary patch'); + $res = $query->('"GIT binary patch"'); + is(scalar(@$res), 1, 'got binary result from "GIT binary patch"'); + is($res->[0]->{mid}, 'binary-patch-test@example', 'msgid for binary'); + my $s = $query->('"literal 1"'); + is_deeply($s, $res, 'got binary result from exact literal size'); + $s = $query->('"literal 2"'); + is_deeply($s, [], 'no results for wrong size'); }); SKIP: {