develooper Front page | perl.perl5.porters | Postings from October 2007

Re: [PATCH] New failing test for RT#45667 (m/[#]/x treated inconsistently)

Thread Previous
From:
demerphq
Date:
October 31, 2007 04:30
Subject:
Re: [PATCH] New failing test for RT#45667 (m/[#]/x treated inconsistently)
Message ID:
9b18b3110710310430q12acc78ag315a81628aa43153@mail.gmail.com
On 10/31/07, Chris Dolan <chris@chrisdolan.net> wrote:
> On Oct 30, 2007, at 11:08 AM, Dave Mitchell wrote:
>
> > Well, they're slightly related, but the two fixes can be developed
> > independently of each other. They both involve making the tokeniser
> > be a
> > bit more clever when processing literal strings. There's a function
> > that
> > scans through characters in a literal string until it finds something
> > "interesting". For example, in the double-quoted string "abc$d", it
> > stops
> > at the $ and returns "abc" as a token.  One fix involves stopping that
> > function thinking that # is interesting when within [], the other
> > involves
> > making it think that '(?{' is interesting.
>
> OK, fair enough.  Consistency is what I seek.  :-)  In that light,
> here's an alternative proposed test patch.  As of 32199, this patch
> yields (abbreviated somewhat):
>
>     ok 1342
>     ok 1343
>     ok 1344
>     not ok 1345 () 'foo \[#\]'x:foo[#]:y:$&:foo[#] => `foo[', match=1
>     not ok 1346 () 'foo [#]':foo#:y:$&:foo# => `'', match=
>     ok 1347
>     ok 1348
>     not ok 1349 () 'foo \[#\]':foo[#]:y:$&:foo[#] => `'', match=
>
> Chris
>
>
> --- t/op/re_tests.orig  2007-10-28 09:26:00.000000000 -0500
> +++ t/op/re_tests       2007-10-30 19:55:16.000000000 -0500
> @@ -1338,3 +1338,12 @@
> .*\z   foo\n   y       -       -
> ^(?:(\d)x)?\d$ 1       y       ${\(defined($1)?1:0)}   0
> .*?(?:(\w)|(\w))x      abx     y       $1-$2   b-
> +
> +'foo [#]'x     foo#    y       $&      foo#
> +'foo [#'x      foo#    c       -       Unmatched [
> +'foo \[#]'x    foo#    n       -       -
> +'foo \[#\]'x   foo[#]  y       $&      foo[#]
> +'foo [#]'      foo#    y       $&      foo#
> +'foo [#'       foo#    c       -       Unmatched [
> +'foo \[#]'     foo#    n       -       -
> +'foo \[#\]'    foo[#]  y       $&      foo[#]

I think there is a way to mark the failing ones as todo tests, youd
have to poke around in the re_tests test file to see how, if not just
modify regexp.t to do it somehow. Probably its just as simple as
saying 'TODO' on the test name, if not, well thats how i would do it.

Im hoping to find some perl related tuits soon.

yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About