----- Original Message ----

> From: jerry gay <jerry....@gmail.com>

> since the :ok adverb is modifying the operator, perl  knows what kind
> of comparison is being attempted, and can automatically give smart
> diagnostics. this point was taken into consideration when the
> adverbial test syntax was originally designed. some examples of perl 6
> tests using adverbial notation:
>   plan *;
>   3 === "3" :ok('int constant is equivalent to string constant integer');
>   3 !~~ "3" :ok('int constant smartmatch to string constant integer')
>   my $x = 284;
>   +$x == 284 :ok('$x is 284');
>   ?$x :ok('$x is True');
> there will no longer be ok() and is() functions, so although is() is
> still a floor wax and a dessert topping, it has nothing to do with
> testing. the comparisons are now explicit, so the intent of the test
> isn't hidden behind a friendly-looking but difficult to debug function
> like is().

Reading through that log more carefully now.  Sorry I didn't do that earlier.

One concern is where Larry asks:

    I wonder how often we'd have people making the error
    of trying to interpoalte into :ok<bad $x pardner>

I'd be one of them.  The following is a very common idiom:

    for my $method (@methods) {
        can_ok $object, $method;
        lives_ok { $object->$method } "... and calling '$method' isn't fatal";

Interpolation in the test description is very important on iterative tests or 
to distingiush similar tests (sometimes it would be nice to go so far as to ban 
identical test descriptions).

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