]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/imap.t
imap: speed up HEADER.FIELDS[.NOT] range fetches
[public-inbox.git] / t / imap.t
index fe6352b678c32fe59a810a5f87d98df1382e926b..451b6596bf9f8d08df021a385d597fcb8eebb807 100644 (file)
--- a/t/imap.t
+++ b/t/imap.t
@@ -46,17 +46,21 @@ use PublicInbox::IMAPD;
        my $partial_body = \&PublicInbox::IMAP::partial_body;
        my $partial_hdr_get = \&PublicInbox::IMAP::partial_hdr_get;
        my $partial_hdr_not = \&PublicInbox::IMAP::partial_hdr_not;
+       my $hdrs_regexp = \&PublicInbox::IMAP::hdrs_regexp;
        is_deeply($x, {
                'BODY[9]' => [ $partial_body, 9, undef, undef, undef ],
                'BODY[9]<5>' => [ $partial_body, 9, undef, 5, undef ],
                'BODY[9]<5.1>' => [ $partial_body, 9, undef, 5, 1 ],
                'BODY[1.1]' => [ $partial_body, '1.1', undef, undef, undef ],
                'BODY[HEADER.FIELDS (DATE FROM)]' => [ $partial_hdr_get,
-                                       undef, 'DATE FROM', undef, undef ],
+                                       undef, $hdrs_regexp->('DATE FROM'),
+                                       undef, undef ],
                'BODY[HEADER.FIELDS.NOT (TO)]' => [ $partial_hdr_not,
-                                               undef, 'TO', undef, undef ],
+                                               undef, $hdrs_regexp->('TO'),
+                                               undef, undef ],
                'BODY[1.1.HEADER.FIELDS (TO)]' => [ $partial_hdr_get,
-                                               '1.1', 'TO', undef, undef ],
+                                               '1.1', $hdrs_regexp->('TO'),
+                                               undef, undef ],
        }, 'structure matches expected');
 }