]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei.t
lei: disallow "\n" in local externals paths
[public-inbox.git] / t / lei.t
diff --git a/t/lei.t b/t/lei.t
index ba179b394ac207f3b4940dbb8049846a468bec8c..2bf4b862557dd8ca6d4599b9d81907064cded29c 100644 (file)
--- a/t/lei.t
+++ b/t/lei.t
@@ -133,12 +133,25 @@ my $test_fail = sub {
        is($? >> 8, 1, 'chdir at end fails to /dev/null');
        lei('-C', '/dev/null', 'q', 'whatever');
        is($? >> 8, 1, 'chdir at beginning fails to /dev/null');
+
+       for my $lk (qw(ei inbox)) {
+               my $d = "$home/newline\n$lk";
+               mkdir $d;
+               open my $fh, '>', "$d/$lk.lock" or BAIL_OUT "open $d/$lk.lock";
+               for my $fl (qw(-I --only)) {
+                       ok(!lei('q', $fl, $d, 'whatever'),
+                               "newline $lk.lock fails with q $fl");
+                       like($lei_err, qr/`\\n' not allowed/,
+                               "error noted with q $fl");
+               }
+       }
 SKIP: {
        skip 'no curl', 3 unless which('curl');
        lei(qw(q --only http://127.0.0.1:99999/bogus/ t:m));
        is($? >> 8, 3, 'got curl exit for bogus URL');
        lei(qw(q --only http://127.0.0.1:99999/bogus/ t:m -o), "$home/junk");
-       is($? >> 8, 3, 'got curl exit for bogus URL with Maildir');
+       is($? >> 8, 3, 'got curl exit for bogus URL with Maildir') or
+               diag $lei_err;
        is($lei_out, '', 'no output');
 }; # /SKIP
 };