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 = new IPC::MorseSignals::Emitter speed => 1024;
15 my $pants = new IPC::MorseSignals::Receiver \%SIG, done => sub {
16 my $cur = shift @msgs;
17 ok($_[1] eq $cur, 'got ' . $_[1] . ', received ' . $cur)
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;