about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-26 09:51:25 +0000
committerEric Wong <e@80x24.org>2021-03-26 23:08:18 +0000
commit65ec1f78464ce8cf4f6379aca7bbae38743c50f0 (patch)
tree0eb594c491282fdec01b7aafc39a45485a39c287 /t
parentd69102cfff67e4308c560c5e8daa8f8a486ff24d (diff)
downloadpublic-inbox-65ec1f78464ce8cf4f6379aca7bbae38743c50f0.tar.gz
Since lei-daemon won't have the same FDs as the client, we
need to special-case thse mappings and won't be able to open
arbitrary, non-standard FDs.

We also won't attempt to support /proc/self/fd/[0-2] since
that's a Linux-ism.  /dev/fd/[0-2] and /dev/std{in,out,err}
are portable to FreeBSD, at least.  mawk(1) also supports
/dev/std{out,err}, as does gawk(1) (which supports everything
we can support, and arbitrary /dev/fd/$FD).
Diffstat (limited to 't')
-rw-r--r--t/lei-convert.t2
-rw-r--r--t/lei-import.t2
2 files changed, 2 insertions, 2 deletions
diff --git a/t/lei-convert.t b/t/lei-convert.t
index e147715d..9b430d8e 100644
--- a/t/lei-convert.t
+++ b/t/lei-convert.t
@@ -87,7 +87,7 @@ test_lei({ tmpdir => $tmpdir }, sub {
         my $exp = do { local $/; <$fh> };
         is($out, $exp, 'stdin => stdout');
 
-        lei_ok qw(convert -F eml -o mboxcl2:/dev/stdout t/plack-qp.eml);
+        lei_ok qw(convert -F eml -o mboxcl2:/dev/fd/1 t/plack-qp.eml);
         open $fh, '<', \$lei_out or BAIL_OUT;
         @bar = ();
         PublicInbox::MboxReader->mboxcl2($fh, sub {
diff --git a/t/lei-import.t b/t/lei-import.t
index a697d756..fa40ad01 100644
--- a/t/lei-import.t
+++ b/t/lei-import.t
@@ -69,7 +69,7 @@ is($res->[0]->{kw}, undef, 'no keywords set');
 
 $eml->header_set('Message-ID', '<k@y>');
 $in = 'From k@y Fri Oct  2 00:00:00 1993'."\n".$eml->as_string;
-lei_ok([qw(import -F mboxrd -)], undef, { %$lei_opt, 0 => \$in },
+lei_ok([qw(import -F mboxrd /dev/fd/0)], undef, { %$lei_opt, 0 => \$in },
         \'import single file with --kw (default) from stdin');
 lei(qw(q m:k@y));
 $res = json_utf8->decode($lei_out);