> On Sep 9, 2016, at 8:34 PM, Sam Kington <[email protected]> wrote:
>
> How should I best extract this functionality into a proper CPAN distribution
> (ideally using Test2)?
I'd start with making it use Test2. Test2 covers a lot of what I see yours
doing. For instance, this code:
structures => [
{
_hashref_contains => {
structure_id => qr{^ (?<structure_id> STRUCT \d+ ) $}x,
type => 'dolmen',
material => 'concrete',
# There's probably stuff about where the dolmen
# was erected but we ignore that for the purpose
# of this test.
}
}
looks like it would be, roughly this in Test2
structures => array(
hash => {
field structure_id => match qr{^ (?<structure_id> STRUCT
\d+ ) $}x;
field type => 'dolmen',
field material => 'concrete',
}
}
--
Andy Lester => www.petdance.com