Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Try Test::LectroTest::Compat

by pernod (Chaplain)
on Feb 17, 2005 at 18:11 UTC ( #432017=note: print w/replies, xml ) Need Help??


in reply to Try Test::LectroTest::Compat
in thread Can I use Test::Differences with Test::LectroTest?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://432017]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2019-08-22 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?