]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei-p2q.t
lei forget-mail-sync: new command to drop sync information
[public-inbox.git] / t / lei-p2q.t
index 87cf9fa7d6d9fcad15097037f5cf8610e72a8f3f..f8b073cfc679a67fa68e5ea352ccf8674d5b358b 100644 (file)
@@ -6,11 +6,13 @@ require_git 2.6;
 require_mods(qw(json DBD::SQLite Search::Xapian));
 
 test_lei(sub {
+       ok(!lei(qw(p2q this-better-cause-format-patch-to-fail)),
+               'p2q fails on bogus arg');
        lei_ok(qw(p2q -w dfpost t/data/0001.patch));
-       is($lei_out, "dfpost:6e006fd73b1d\n", 'pathname');
-       open my $fh, '+<', 't/data/0001.patch';
+       is($lei_out, "dfpost:6e006fd73b1d\n", 'pathname') or diag $lei_err;
+       open my $fh, '+<', 't/data/0001.patch' or xbail "open: $!";
        lei_ok([qw(p2q -w dfpost -)], undef, { %$lei_opt, 0 => $fh });
-       is($lei_out, "dfpost:6e006fd73b1d\n", '--stdin');
+       is($lei_out, "dfpost:6e006fd73b1d\n", '--stdin') or diag $lei_err;
 
        lei_ok(qw(p2q --uri t/data/0001.patch -w), 'dfpost,dfn');
        is($lei_out, "dfpost%3A6e006fd73b1d+".