1 | #!perl |
1 | #!perl |
|
|
2 | |
2 | use strict; |
3 | use strict; |
|
|
4 | use AnyEvent::Impl::Perl; |
3 | use AnyEvent::Handle; |
5 | use AnyEvent::Handle; |
4 | use Test::More tests => 2; |
6 | use Test::More tests => 2; |
5 | use Socket; |
7 | use Socket; |
6 | |
|
|
7 | |
8 | |
8 | { |
9 | { |
9 | my $cv = AnyEvent->condvar; |
10 | my $cv = AnyEvent->condvar; |
10 | |
11 | |
11 | socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC; |
12 | socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC; |
… | |
… | |
26 | $wr->syswrite (("X" x 113) . "\n"); |
27 | $wr->syswrite (("X" x 113) . "\n"); |
27 | $wr->close; |
28 | $wr->close; |
28 | |
29 | |
29 | $cv->wait; |
30 | $cv->wait; |
30 | |
31 | |
31 | is ($concat, "ABCDEFG".("X"x113), 'lines were read correctly'); |
32 | is ($concat, "ABCDEFG".("X" x 113), 'lines were read correctly'); |
32 | } |
33 | } |
33 | |
34 | |
34 | { |
35 | { |
35 | my $cv = AnyEvent->condvar; |
36 | my $cv = AnyEvent->condvar; |
36 | |
37 | |
… | |
… | |
55 | $wr->syswrite (("X" x 113) . "\n"); |
56 | $wr->syswrite (("X" x 113) . "\n"); |
56 | $wr->close; |
57 | $wr->close; |
57 | |
58 | |
58 | $cv->wait; |
59 | $cv->wait; |
59 | |
60 | |
60 | is ($concat, "ABCDEFG".("X"x113), 'second lines were read correctly'); |
61 | is ($concat, "ABCDEFG".("X" x 113), 'second lines were read correctly'); |
61 | } |
62 | } |