I didn't see this node until today. Sorry for the delay.

Test::LectroTest::Compat fits the bill. I had to download the package from your website and install manually though, but this looks like an issue with my CPAN mirror. Anyhow, the above example with Test::Differences rewritten to Test::LectroTest::Compat:

#! /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 );

Which gives me the expected:

shiny:~/dev/perl$ perl lec.pl 1..1 ok 1 - property 'Finding $x's square. Twice!' (1000 attempts)

Once again, thank you very much for a great module!

pernod
--
Mischief. Mayhem. Soap.


In reply to Re: Try Test::LectroTest::Compat by pernod
in thread Can I use Test::Differences with Test::LectroTest? by pernod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.