# Copyright (C) 2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict; use v5.10.1; use PublicInbox::TestCommon;
-use PublicInbox::Spawn qw(which);
require_mods(qw(lei -httpd));
-which('curl') or plan skip_all => "curl required for $0";
+require_cmd('curl');
my ($ro_home, $cfg_path) = setup_public_inboxes;
my ($tmpdir, $for_destroy) = tmpdir;
my $sock = tcp_server;
my $url = "http://$host_port/t2";
for my $p (qw(bogus@x/t.mbox.gz bogus@x/raw ?q=noresultever)) {
ok(!lei('import', "$url/$p"), "/$p fails properly");
+ like($lei_err, qr/curl.*404/, 'got curl 404');
}
for my $p (qw(/ /T/ /t/ /t.atom)) {
ok(!lei('import', "$url/m\@example$p"), "/$p fails");
ok(!lei(qw(import --mail-sync), "$url/x\@example.com/raw"),
'--mail-sync fails on HTTP');
- diag $lei_err;
-
+ like($lei_err, qr/--mail-sync/, 'error message notes --mail-sync');
});
done_testing;