Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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?
[thezip]: Good evening!

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2017-06-29 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (653 votes). Check out past polls.