6 use Test::More tests => 9;
8 use IPC::MorseSignals::Emitter;
9 use IPC::MorseSignals::Receiver;
11 my @msgs = qw<hlagh hlaghlaghlagh HLAGH HLAGHLAGHLAGH \x{0dd0}\x{00}
12 h\x{00}la\x{00}gh \x{00}\x{ff}\x{ff}\x{00}\x{00}\x{ff}>;
14 my $deuce = IPC::MorseSignals::Emitter->new(speed => 1024);
15 my $pants = IPC::MorseSignals::Receiver->new(\%SIG, done => sub {
16 my $cur = shift @msgs;
17 is($_[1], $cur, "message correctly received");
20 $deuce->post($_) for @msgs;
23 ok(!$deuce->busy, 'emitter is no longer busy after all the messages have been sent');
24 ok(!$pants->busy, 'receiver is no longer busy after all the messages have been got');
26 ok(0, "didn't got $_") for @msgs;