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

substr( $str, $pos, 0 ) in rakudo returns rest of string, not empty string #206

Closed
p6rt opened this issue Jul 30, 2008 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jul 30, 2008

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

Searchable as RT57434$

@p6rt
Copy link
Author

p6rt commented Jul 30, 2008

From @masak

$ svn info | grep Revi
Revision​: 29869

$ ./perl6 -e 'say substr( "foo", 0, 2 )'
fo
$ ./perl6 -e 'say substr( "foo", 0, 1 )'
f
$ ./perl6 -e 'say substr( "foo", 0, 0 )' # wrong!
foo

$ ./perl6 -e 'say substr( "foo", 1, 2 )'
oo
$ ./perl6 -e 'say substr( "foo", 1, 1 )'
o
$ ./perl6 -e 'say substr( "foo", 1, 0 )' # wrong!
oo

@p6rt
Copy link
Author

p6rt commented Jul 30, 2008

From @moritz

Just FYI, there are now two tests for that (marked as TODO) in
t/spec/S29-str/substr.t

Carl MXXsak (via RT) wrote​:

# New Ticket Created by "Carl Mäsak"
# Please include the string​: [perl #​57434]
# in the subject line of all future correspondence about this issue.
# <URL​: http://rt.perl.org/rt3/Ticket/Display.html?id=57434 >

$ svn info | grep Revi
Revision​: 29869

$ ./perl6 -e 'say substr( "foo", 0, 2 )'
fo
$ ./perl6 -e 'say substr( "foo", 0, 1 )'
f
$ ./perl6 -e 'say substr( "foo", 0, 0 )' # wrong!
foo

$ ./perl6 -e 'say substr( "foo", 1, 2 )'
oo
$ ./perl6 -e 'say substr( "foo", 1, 1 )'
o
$ ./perl6 -e 'say substr( "foo", 1, 0 )' # wrong!
oo

--
Moritz Lenz
http://moritz.faui2k3.org/ | http://perl-6.de/

@p6rt
Copy link
Author

p6rt commented Jul 30, 2008

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

@p6rt
Copy link
Author

p6rt commented Aug 3, 2008

From @pmichaud

Now fixed in r29970, thanks!

Pm

1 similar comment
@p6rt
Copy link
Author

p6rt commented Aug 3, 2008

From @pmichaud

Now fixed in r29970, thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Aug 3, 2008

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

@p6rt p6rt closed this as completed Aug 3, 2008
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