Mark Stosberg wrote in perl.qa :
> I'm frequently using 'like' to test $agent->content against a regular
> expression.
>   
> When I have a lot of these in a new test script and they are all
> failing, I get a boatload of HTML source floating by, which
> makes it tedious at times to find out what actually went wrong.
>   
> I would like a way to tune the amount context that "like" presents
> upon failure. For example, the first 1000 characters of the HTML source
> would do most of the time. I'm not sure what the best way to do this might be.
> For now, I'll stop at merely suggesting something like this might be useful. :)

Write your own test module on top of Test::Builder / Test::More.

I faced a similar problem with is() for very long strings and/or strings
that may contain non printable characters :

http://search.cpan.org/~RGARCIA/Test-LongString-0.02/lib/Test/LongString.pm

Now, it seems like your proposed long-string friendly like() is
something that could go in Test::LongString. Patches welcome, of course,
but I may look at implementing this myself. Other suggestions ?

Reply via email to