8 use Test::More tests => 7;
10 use IPC::MorseSignals::Emitter;
11 use IPC::MorseSignals::Receiver;
13 my @msgs = qw/€éèë 月語 x tata たTÂ/;
15 sub cp { join '.', map ord, split //, $_[0] }
17 my $deuce = new IPC::MorseSignals::Emitter speed => 1024;
18 my $pants = new IPC::MorseSignals::Receiver \%SIG, done => sub {
19 my $cur = shift @msgs;
20 ok($_[1] eq $cur, 'got ' . cp($_[1]) . ', expected ' . cp($cur))
23 $deuce->post($_) for @msgs;
26 ok(!$deuce->busy, 'emitter is no longer busy after all the messages have been sent');
27 ok(!$pants->busy, 'receiver is no longer busy after all the messages have been got');
29 ok(0, 'didn\'t got ' . cp($_)) for @msgs;