1 # Copyright (C) 2015 all contributors <meta@public-inbox.org>
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
8 use_ok 'PublicInbox::NNTP';
12 my (undef, $s) = split(/ = /, Dumper($_[0]), 2);
20 PublicInbox::NNTP::wildmat2re($_[0]);
21 my $new = quote_str($_[0]);
27 my ($orig, $new) = wm_prepare($wm);
28 like($str, $wm, "$orig matches '$str' using $new");
32 my ($str, $wm, $check_ex) = @_;
36 like($str, $re, "normal re with $wm matches, but ...");
38 my ($orig, $new) = wm_prepare($wm);
39 unlike($str, $wm, "$orig does not match '$str' using $new");
42 wildmat_like('[foo]', '[\[foo\]]');
43 wildmat_like('any', '*');
44 wildmat_unlike('bar.foo.bar', 'foo.*');
47 wildmat_unlike('HI', '(?{"HI"})', 1);
48 wildmat_unlike('HI', '[(?{"HI"})]', 1);
55 PublicInbox::NNTP::ngpat2re($pat);
56 like($str, $pat, "'$orig' matches '$str' using $pat");
59 ngpat_like('any', '*');
60 ngpat_like('a.s.r', 'a.t,a.s.r');
61 ngpat_like('a.s.r', 'a.t,a.s.*');