3 use Test::More tests => 6;
5 use POSIX qw/SIGTERM SIGKILL EXIT_SUCCESS/;
7 use IPC::MorseSignals qw/msend mrecv/;
10 my ($msg, $desc) = @_;
11 pipe $rdr, $wtr or die "pipe() failed : $!";
14 die "fork() failed : $!";
17 local @SIG{qw/USR1 USR2/} = mrecv sub {
18 print $wtr $_[0], "\n";
23 close $wtr or die "close() failed : $!";
24 msend $msg => $pid, 100;
26 local $SIG{ALRM} = sub { die };
37 my $recv = do { local $/; <$rdr> };
40 ok($msg eq $recv, $desc);
43 try2send 'hello', 'ascii';
44 try2send 'éàùçà', 'extended';
45 try2send '€€€', 'unicode';
46 try2send 'a€bécàd€e', 'mixed';
47 try2send "\x{FF}", 'lots of bits';
48 try2send "a\0b", 'null character';