2 # Copyright (C) 2021 all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use strict; use v5.10.1; use PublicInbox::TestCommon;
6 require_mods(qw(json DBD::SQLite Search::Xapian));
9 lei_ok(qw(p2q -w dfpost t/data/0001.patch));
10 is($lei_out, "dfpost:6e006fd73b1d\n", 'pathname');
11 open my $fh, '+<', 't/data/0001.patch';
12 lei_ok([qw(p2q -w dfpost -)], undef, { %$lei_opt, 0 => $fh });
13 is($lei_out, "dfpost:6e006fd73b1d\n", '--stdin');
15 lei_ok(qw(p2q --uri t/data/0001.patch -w), 'dfpost,dfn');
16 is($lei_out, "dfpost%3A6e006fd73b1d+".
17 "dfn%3Alib%2FPublicInbox%2FSearch.pm\n",
18 '--uri -w dfpost,dfn');
19 lei_ok(qw(p2q t/data/0001.patch), '--want=dfpost,OR,dfn');
20 is($lei_out, "dfpost:6e006fd73b1d OR dfn:lib/PublicInbox/Search.pm\n",
22 lei_ok(qw(p2q t/data/0001.patch --want=dfpost9));
23 is($lei_out, "dfpost:6e006fd73b1d OR " .
24 "dfpost:6e006fd73b1 OR " .
25 "dfpost:6e006fd73b OR " .
29 lei_ok(qw(p2q t/data/message_embed.eml --want=dfb));
30 like($lei_out, qr/\bdfb:\S+/, 'got dfb off /dev/null file');