Thanks for your feedback on LectroTest, and your example with Test::MockObject is a cool use. (BTW, I don't think that calculating the expected score in the Property is an abuse at all.)
If you don't mind a suggestion, you could simplify the data-building portion of your code by letting LectroTest build the more-complicated data structure for you:
#!/usr/bin/perl
use strict;
use Data::Dumper;
use Test::LectroTest trials => 10;
use List::Util qw( reduce );
$Data::Dumper::Terse = 1;
Property {
##[ data <- List( Hash( Unit(1)
, Int( range=>[50,100], sized=>0 )
, length=>1 )
, length=>5 )
]##
my @input = map { values %$_ } @$data;
my $questions = reduce { $a + $b } @input;
print STDERR Dumper( { data => $data
, input => \@input
, questions => $questions } ), "\n";
1; # always passes trials
}, name => "shell property that holds a generator example";
Also, for the Int generator, you shouldn't specify a range that does not contain zero if the generator is sized. The reason for this rule is that at run time, the intersection of the sizing-guidance range and your given range can be empty, thus making it impossible to generate a valid value.
(I have updated the LectroTest::Generator docs to reflect this, and LectroTest will now complain if you try to combine these settings.)
Thanks again for taking the time to provide feedback!
Cheers,
Tom