package main;
use Evo::Base -strict;
use Test::More;
use Evo::MDN;
use Test::Fatal;
use Hash::Util::FieldHash qw(register id id_2obj);

my ($FROM, $MSG, $DESTROYED);
my $mdn  = Evo::MDN->new;
my $from = Evo::Base->new;

my ($res, $me, $id);

# firstly check if implementation didn't change

$me = Evo::Base->new;
$mdn->subscribe($me, $from, 0, sub { shift; $res = shift });

$mdn->broadcast($from, 'foo');
is $res, 'foo';

undef $me;
$mdn->broadcast($from, 'BAD');
is $res, 'foo';


done_testing;
