Maybe I'm off with my next comment and maybe I'm not but here it goes:

What you're suggesting is a difference between mechanizm and policy.  We
want a function that will be just like Test::More::like, but we want it to
only output a certain amount of chars because frankly we don't want to see
all of the HTML.  The function like_html(actual_value, expected_regex,
max_chars_to_output, string_description) is our mechanizm.  The global
config var is a policy.  What's stopping you from creating this global var
and passing it in to the function whenever it is called?  Or you could make
the function "smart" enough as to if there isn't a max_chars_to_output param
it looks for a certain "global config var" and if that's undefined it acts
just like Test::More::like.  

The implementation is your choice, but one thing you should consider is the
separation between your function's mechanizm and policy.

Toodles,
~~Andrew

> -----Original Message-----
> From: Rafael Garcia-Suarez [mailto:[EMAIL PROTECTED] 
> Sent: Monday, November 17, 2003 4:24 AM
> To: Potozniak, Andrew
> Cc: [EMAIL PROTECTED]
> Subject: Re: thinking about variable context for like()
> 
> 
> Potozniak, Andrew wrote:
> >
> > I would suggest something along the lines of:
> > 
> >     &like_html(actual_value, expected_regex, max_chars_to_output, 
> > string_description);
> 
> In fact I think that making max_chars_to_output a global 
> configuration variable is a better option, because repeating 
> it (if you have lots of tests) will become quickly fastidious.
> 

Reply via email to