On Tue, Jun 30, 2009 at 2:46 PM, David Golden<xda...@gmail.com> wrote:
> On Tue, Jun 30, 2009 at 2:15 PM, Ovid<publiustemp-perl...@yahoo.com> wrote:
>> Also, I think playing around with more fluent interfaces is a good idea.  If 
>> my interface is great, why not?  If it's bad, what would people *love* to 
>> see in a test interface which allows them to naturally write tests?
>
> Well, if you're doing interface design, one of the first things that
> comes to mind is that the name of the test should come first, not
> last.
>
> I've often taken to writing tests like this:
>
>    is( $have, $want
>      "label goes here"
>    );
>


how about

fn_label_goes_here_is ($have, $want, "maybe a supplememtary msg")

with AUTOLOAD catching it, recognize the _is suffix,
convert the fn-label-goes-here into a more readable message.

+ suffix carries exactly current meaning (no grey area)
+ test label and implementing function are ALWAYS clearly associated.
(no more counting $i++'s)
+ name prefix can be guaranteed unique (by erroring on reused prefixes)
  or encouraged (with warning)
  or tacitly done (with _N_ infix)
  or some more subtle combo - limited mostly by need for a clear description.

- AUTOLOAD is its own kind of ugliness..
- dont really want such an enormous dependence on a not-quite-basic feature.

Reply via email to