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

calling index with negative start position on string does not return Nil #4769

Closed
p6rt opened this issue Nov 21, 2015 · 4 comments
Closed

calling index with negative start position on string does not return Nil #4769

p6rt opened this issue Nov 21, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 21, 2015

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

Searchable as RT126700$

@p6rt
Copy link
Author

p6rt commented Nov 21, 2015

From @usev6

rakudo.jvm seems to ignore that $pos is negative in the following example​:

$ perl6-j -e 'say index("xxy", "y", -1)'
2

$ perl6-m -e 'say index("xxy", "y", -1)'
Nil

There are failing tests for rakudo.jvm in S32-str/index.t.

@p6rt
Copy link
Author

p6rt commented Nov 22, 2015

From @usev6

After Rakudo commit negative start positions are disallowed​:

$ perl6 -e 'say index("xxy", "y", -1).perl'
Failure.new(exception => X​::OutOfRange.new(what => "Position in index", got => -1, range => "0..3", comment => Any), backtrace => Backtrace.new)

Tested in S32-str/index.t and S32-str/rindex.t

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 22, 2015

From @usev6

After Rakudo commit negative start positions are disallowed​:

$ perl6 -e 'say index("xxy", "y", -1).perl'
Failure.new(exception => X​::OutOfRange.new(what => "Position in index", got => -1, range => "0..3", comment => Any), backtrace => Backtrace.new)

Tested in S32-str/index.t and S32-str/rindex.t

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Nov 22, 2015
@p6rt
Copy link
Author

p6rt commented Nov 22, 2015

@usev6 - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant