]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/config.t
t/run: show unexpected output lines in logs
[public-inbox.git] / t / config.t
index 3f41c0042a9e962b0628b01c05af8b2dfcc9c6ba..ad543ad3638c0c0c78022502bfef812fdf2492bd 100644 (file)
@@ -225,4 +225,22 @@ EOF
                'bogus is undef');
 }
 
+SKIP: {
+       require_git('1.8.5', 2) or
+               skip 'git 1.8.5+ required for --url-match', 2;
+       my $f = "$tmpdir/urlmatch";
+       open my $fh, '>', $f or BAIL_OUT $!;
+       print $fh <<EOF or BAIL_OUT $!;
+[imap "imap://*.example.com"]
+       pollInterval = 9
+EOF
+       close $fh or BAIL_OUT;
+       local $ENV{PI_CONFIG} = $f;
+       my $cfg = PublicInbox::Config->new;
+       my $url = 'imap://mail.example.com/INBOX';
+       is($cfg->urlmatch('imap.pollInterval', $url), 9, 'urlmatch hit');
+       is($cfg->urlmatch('imap.idleInterval', $url), undef, 'urlmatch miss');
+};
+
+
 done_testing();