http://www.perlmonks.org?node_id=481941


in reply to Re: How to Ask a Regex Question (with Test::More) (repost, with Sitedocclan approval)
in thread How to Ask a Regex Question (with Test::More) (repost, with Sitedocclan approval)

I assumed that Test::More would have this in the bag, but went ahead and checked. Test::More certainly handles this already with an unlinke($this, $regex). This should probably be mentioned in the template (which I'm sure is what you meant.) As for matching HOW it matched, that would be an interesting problem. Perhaps a the test harness should accept an arrayref where the first element is the regex and the following should be $1..$9 in order?

like("Hello World", [ /(.+)\s(.+)/, "Hello", "World"]);

Seems like a mouth full but it would handler your case.

Just my two cents.


___________
Eric Hodges
  • Comment on Re^2: How to Ask a Regex Question (with Test::More) (repost, with Sitedocclan approval)
  • Download Code