Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Exception CPAN distribution.

Report information
The Basics
Id: 59293
Status: resolved
Priority: 0/
Queue: Test-Exception

People
Owner: Nobody in particular
Requestors: david.tulloh [...] AirservicesAustralia.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.29
Fixed in: (no value)



Subject: Regexp with anchors fails to match
I can't seem to use regex anchors to force the match to the start or end of a string. For example: throws_ok {die "foo"} qr/^foo$/, "Throws with regex anchors"; not ok 1 - Throws with regex anchors # Failed test 'Throws with regex anchors' # at CountryCodes.t line 9. # expecting: Regexp ((?-xism:^foo$)) # found: foo at CountryCodes.t line 9. This passes: throws_ok {die "foo"} qr/foo/, "Throws with regex anchors";
Hi David, It's doing exactly what you ask :-) You have to remember that the exception string thrown by perl _includes_ the line number so it's trying to match "foo" with "foo at CountryCodes.t line 9" and correctly failing. Hope that makes sense. Ask if you have any questions :-) Thanks, Adrian On Tue Jul 13 02:31:58 2010, david.tulloh@AirservicesAustralia.com wrote: Show quoted text
> I can't seem to use regex anchors to force the match to the start or end > of a string. For example: > > throws_ok {die "foo"} qr/^foo$/, "Throws with regex anchors"; > > not ok 1 - Throws with regex anchors > # Failed test 'Throws with regex anchors' > # at CountryCodes.t line 9. > # expecting: Regexp ((?-xism:^foo$)) > # found: foo at CountryCodes.t line 9. > > > This passes: > throws_ok {die "foo"} qr/foo/, "Throws with regex anchors";
From: david.tulloh [...] AirservicesAustralia.com
On Thu Aug 19 10:07:36 2010, ADIE wrote: Show quoted text
> Hi David, > > It's doing exactly what you ask :-) > > You have to remember that the exception string thrown by perl > _includes_ the line number so > it's trying to match "foo" with "foo at CountryCodes.t line 9" and > correctly failing.
Thanks, that makes perfect sense when you point it out. I know the documentation for throws_ok is already fairly long but you may want to add something that addresses this in there. With all the talk of exceptions I had forgotten that what you were really dealing with was perl die strings and I suspect many others would too.
Subject: Re: [rt.cpan.org #59293] Regexp with anchors fails to match
Date: Mon, 6 Sep 2010 15:43:57 +0100
To: bug-Test-Exception [...] rt.cpan.org
From: Adrian Howard <adrianh [...] quietstars.com>
I'll add some clarification in the next release Adrian On 20 August 2010 01:56, Tulloh, David via RT < bug-Test-Exception@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Exception > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59293 > > > On Thu Aug 19 10:07:36 2010, ADIE wrote:
> > Hi David, > > > > It's doing exactly what you ask :-) > > > > You have to remember that the exception string thrown by perl > > _includes_ the line number so > > it's trying to match "foo" with "foo at CountryCodes.t line 9" and > > correctly failing.
> > Thanks, that makes perfect sense when you point it out. > > I know the documentation for throws_ok is already fairly long but you > may want to add something that addresses this in there. With all the > talk of exceptions I had forgotten that what you were really dealing > with was perl die strings and I suspect many others would too. > >
-- http://quietstars.com - twitter.com/adrianh - delicious.com/adrianh
Subject: Re: [rt.cpan.org #59293] Regexp with anchors fails to match
Date: Mon, 6 Sep 2010 15:43:57 +0100
To: bug-Test-Exception [...] rt.cpan.org
From: Adrian Howard <adrianh [...] quietstars.com>
I'll add some clarification in the next release Adrian On 20 August 2010 01:56, Tulloh, David via RT < bug-Test-Exception@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Exception > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=59293 > > > On Thu Aug 19 10:07:36 2010, ADIE wrote:
> > Hi David, > > > > It's doing exactly what you ask :-) > > > > You have to remember that the exception string thrown by perl > > _includes_ the line number so > > it's trying to match "foo" with "foo at CountryCodes.t line 9" and > > correctly failing.
> > Thanks, that makes perfect sense when you point it out. > > I know the documentation for throws_ok is already fairly long but you > may want to add something that addresses this in there. With all the > talk of exceptions I had forgotten that what you were really dealing > with was perl die strings and I suspect many others would too. > >
-- http://quietstars.com - twitter.com/adrianh - delicious.com/adrianh
There's a doc patch in github now http://github.com/adrianh/test- exception/commit/145bbd21342dfacbdb5c91a6ea27b004b885a054 which go out in the next release. Ta, Adrian