Data-MinHash-Shared
view release on metacpan or search on metacpan
t/03-frozen.t view on Meta::CPAN
$A->add("local");
$A->merge($Bro); # must read Bro's registers without locking its PROT_READ map
my $U = Data::MinHash::Shared->new(undef, $k); # reference: union built directly
$U->add($_) for ("local", qw(xx yy zz));
is_deeply [ $A->registers ], [ $U->registers ], 'merge from a frozen other == the union sketch';
}
done_testing;
# minimal exception helper (avoid a Test::Fatal dependency)
sub exception {
my $code = shift;
my $err;
{ local $@; eval { $code->(); 1 } or $err = $@; }
return $err;
}
( run in 1.292 second using v1.01-cache-2.11-cpan-54e63673c56 )