develooper Front page | perl.qa | Postings from September 2016

Re: CPANifying our test framework - or parts of it

Thread Previous | Thread Next
From:
Andy Lester
Date:
September 10, 2016 19:00
Subject:
Re: CPANifying our test framework - or parts of it
Message ID:
5917FA58-7CD6-433D-A6AE-F98E803E95CF@petdance.com

> On Sep 9, 2016, at 8:34 PM, Sam Kington <sam@illuminated.co.uk> 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


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About