1 #!./perl -- -*- mode: cperl; cperl-indent-level: 4 -*-
4 require Config; import Config;
5 unless ($Config{d_fork}) {
11 $ENV{PERL5LIB} = '../lib'; # so children will see it too
15 use IPC::Open3 qw(open3);
24 @prgs = split "########\n", <DATA>;
30 plan tests => scalar @prgs;
34 $ENV{PERLDB_OPTS} = "TTY=0";
35 my($ornament1,$ornament2,$wtrfh,$rdrfh);
36 open3 $wtrfh, $rdrfh, 0, $^X, "-de0";
37 my $ios = IO::Select->new();
40 my($prog,$expected) = split(/\nEXPECT\n?/, $_);
41 print $wtrfh $prog, "\n";
43 while (not defined $got) {
44 while ($ios->can_read(0.25)) {
45 sysread $rdrfh, $got, 1024, length($got);
48 $got =~ s/^\s*Loading.*\nEditor.*\n\nEnter.*\n\nmain::\(-e:1\):\s0\n//;
49 unless (defined $ornament1) {
50 $got =~ s/^\s*Loading.*\nEditor.*\n\nEnter.*\n\nmain::\(-e:1\):\s0\n//;
51 ($ornament1,$ornament2) = $got =~
52 /(.*?)0\s+'reserved example for calibrating the ornaments'\n(.*)/
54 $got =~ s/^\Q$ornament1\E//;
55 $got =~ s/\Q$ornament2\E\z//;
56 like($got, qr:$expected:i, $prog);
60 x "reserved example for calibrating the ornaments"
62 0 'reserved example for calibrating the ornaments'
84 0\s+HASH\(0x[0-9a-f]+\)