Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:x() in .subst does not fail when there aren't enough matches #470

Closed
p6rt opened this issue Dec 9, 2008 · 4 comments
Closed

:x() in .subst does not fail when there aren't enough matches #470

p6rt opened this issue Dec 9, 2008 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Dec 9, 2008

Migrated from rt.perl.org#61204 (status was 'resolved')

Searchable as RT61204$

@p6rt
Copy link
Author

p6rt commented Dec 9, 2008

From @masak

Rakudo r33613 treats the :x($n) adverb as "up to $n matches", not (as
specced) "exactly $n matches".

$ perl6 -e 'say "foofoofoo".subst("foo", "bar", :x(3))' # right
barbarbar

$ perl6 -e 'say "foofoofoo".subst("foo", "bar", :x(4))' # wrong
barbarbar

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

From @jnthn

On Tue Dec 09 02​:00​:40 2008, masak wrote​:

Rakudo r33613 treats the :x($n) adverb as "up to $n matches", not (as
specced) "exactly $n matches".

$ perl6 -e 'say "foofoofoo".subst("foo", "bar", :x(3))' # right
barbarbar

$ perl6 -e 'say "foofoofoo".subst("foo", "bar", :x(4))' # wrong
barbarbar

Fixed (plus for the regex case) in git 01811bf. Note the spec says it
hands back the original string rather than any kind of more epic fail,
so far as I can tell. Unfudged a couple of tests in subst.t too.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Feb 13, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Feb 13, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant