about summary refs log tree commit homepage
path: root/t/search.t
diff options
context:
space:
mode:
Diffstat (limited to 't/search.t')
-rw-r--r--t/search.t15
1 files changed, 15 insertions, 0 deletions
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: {