package main;
use Evo::Base -strict;
use Test::More 'skip_all';
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 ($me, $id);

# firstly check if implementation didn't change

$me = Foo->new;
$id = id $me;


$mdn->subscribe($me, $from, sub { }, 1);
undef $me;
use Data::Dumper;
say Dumper $mdn->_all_senders;
say Dumper $mdn->_all_store;
undef $from;
use Data::Dumper;
say Dumper $mdn->_all_senders;
say Dumper $mdn->_all_store;

{

  package Foo;
  use Evo::Base -base;
  sub DESTROY { say shift }
}

done_testing;
