]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei-lcat.t
lei lcat: extract Message-IDs from URLs and show them
[public-inbox.git] / t / lei-lcat.t
diff --git a/t/lei-lcat.t b/t/lei-lcat.t
new file mode 100644 (file)
index 0000000..e5f0070
--- /dev/null
@@ -0,0 +1,16 @@
+#!perl -w
+# 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;
+require_mods(qw(lei));
+
+test_lei(sub {
+       my $in = "\nMessage-id: <qp\@example.com>\n";
+       lei_ok([qw(lcat --stdin)], undef, { 0 => \$in, %$lei_opt });
+       unlike($lei_out, qr/\S/, 'nothing, yet');
+       lei_ok('import', 't/plack-qp.eml');
+       lei_ok([qw(lcat --stdin)], undef, { 0 => \$in, %$lei_opt });
+       like($lei_out, qr/qp\@example\.com/, 'got a result');
+});
+
+done_testing;