----- Original Message ----

> From: Michael Peters <mpet...@plusthree.com>
>
> >     use Test::Fluent 'no_plan';
> > 
> >     my ( $have, $want ) = ( 1, 1 );
> >     have $have, want $want, reason 'Some test name';
> >     have [ 3, 4 ], want [ 4, 5 ], reason 'cuz I said so';   # fails
> >     true 3,  reason '3 had better be true';
> >     false 3, reason '3 had better still better be true';    # fails
> 
> I would much rather see something like
> 
> cmp_ok(
>   have       => 1,
>   want       => 2,
>   reason     => 'Some test name',
>   diagnostic => { world => $world },
> );
> 
> Much more Perlish. I've always disliked some APIs where it's not immediately 
> clear what's a function call and what's an argument to that function: is 
> reason() an argument to want() or have()?. It also seems more obvious for 
> doing 
> things like data-driven tests where you just have a large data structure that 
> tests are run against.

I've thought about this idea for the past couple of days and while there's 
nothing *wrong* with your cmp_ok() idea, it doesn't do anything for me.  I'm 
rather curious about stretching my wings, so to speak, and seeing how 
interesting an interface I could create and whether or not it's useful.  
cmp_ok() is old ground and anyone could write it.

As for your comment "what's a function call and what's an argument", I know 
what you mean, but again, how can we think about something in a larger context 
and see what we can accomplish?  I want to try something new.


Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Reply via email to