Dear Maintainer,

The bug also occurs if the STDIN callback attempts to return an empty array in it's own scope.


David




2014-05-03 13:03:19 dpchrist@dev ~/sandbox/perl
$ cat IPC-Run-run_stdin-callback-return-array.t
#! /usr/bin/perl
# $Id: IPC-Run-run_stdin-callback-return-array.t,v 1.5 2014-05-03 20:03:15 dpchrist Exp $
# Demonstrate Perl IPC::Run stdin callback problem returning array
# by David Paul Christensen dpchr...@holgerdanske.com
# Public Domain

use strict;
use warnings;

use IPC::Run qw( run );
use Test::More                  tests => 9;

my @cmd = ("true");
our ($i, @i);
my ($in, @in);

ok( run( \@cmd                      ) == 1, "no callback");   #     1
ok (run( \@cmd, sub { return undef }) == 1, "undef");         #     2
ok (run( \@cmd, sub { return ""    }) == 1, "empty string");        #     3
ok (run( \@cmd, sub { return ()    }) == 1, "empty array");   #     4
ok (run( \@cmd, sub { return $i    }) == 1, "package scalar");        #     5
ok (run( \@cmd, sub { return $in   }) == 1, "lexical scalar");        #     6
ok (run( \@cmd, sub { my @a; return @a }) == 1,
    "block lexical array");                                   #     7
ok (run( \@cmd, sub { return @i    }) == 1, "package array"); #     8
ok (run( \@cmd, sub { return @in   }) == 1, "lexical array"); #     9


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to