Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: How to Ask a Regex Question (with Test::More) (repost, with Sitedocclan approval)

by eric256 (Parson)
on Aug 08, 2005 at 17:13 UTC ( #481941=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://481941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-08-21 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls