#! /usr/bin/perl use Test::More tests => 1; use Test::LectroTest::Compat; use Test::Differences; sub square { my $square = $_[ 0 ] * $_[ 0 ]; return [ $square, $square ]; } my $square_property = Property { ##[ x <- Int #]## my $sq = $x * $x; eq_or_diff( square( $x ), [ $sq, $sq ] ); }, name => "Finding \$x's square. Twice!"; holds( $square_property ); #### shiny:~/dev/perl$ perl lec.pl 1..1 ok 1 - property 'Finding $x's square. Twice!' (1000 attempts)