Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ec04fa7e
Commit
ec04fa7e
authored
Jun 19, 2014
by
Akito Mochizuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify return value of String#slice! if idx == self.size
parent
ba0ddb78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
mrbgems/mruby-string-ext/mrblib/string.rb
mrbgems/mruby-string-ext/mrblib/string.rb
+1
-1
mrbgems/mruby-string-ext/test/string.rb
mrbgems/mruby-string-ext/test/string.rb
+1
-1
No files found.
mrbgems/mruby-string-ext/mrblib/string.rb
View file @
ec04fa7e
...
...
@@ -169,7 +169,7 @@ class String
if
arg1
!=
nil
&&
arg2
!=
nil
idx
=
arg1
idx
+=
self
.
size
if
arg1
<
0
if
idx
>=
0
&&
idx
<
self
.
size
&&
arg2
>
0
if
idx
>=
0
&&
idx
<
=
self
.
size
&&
arg2
>
0
str
=
self
[
idx
,
arg2
]
else
return
nil
...
...
mrbgems/mruby-string-ext/test/string.rb
View file @
ec04fa7e
...
...
@@ -218,7 +218,7 @@ assert('String#slice!') do
assert_equal
"Foo"
,
a
a
=
"FooBar"
assert_
nil
a
.
slice!
(
6
,
2
)
assert_
equal
""
,
a
.
slice!
(
6
,
2
)
assert_equal
"FooBar"
,
a
a
=
"FooBar"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment