willjones has asked for the wisdom of the Perl Monks concerning the following question:
my $myObjs = { alpha => re('^alpha(.*)'), beta => re('\d+'), #myOptionalField => re('^opt(.*)'), #sometimes there is a "myOpti +onalField", but sometimes there is not. What to do? }; cmp_deeply( $response, { field1 => re('\d+'), field2 => 2, field3 => 1, objects => array_each($myObjs) }, 'testing for valid response structure' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unit testing question with Test::Deep
by pokki (Monk) on Jun 18, 2013 at 09:02 UTC | |
by willjones (Sexton) on Jun 18, 2013 at 15:21 UTC |