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
3b76aae4
Commit
3b76aae4
authored
Jan 10, 2014
by
Tomoyuki Sahara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ISO reference number of String#=~.
parent
3046cc7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
mrblib/string.rb
mrblib/string.rb
+1
-1
test/t/string.rb
test/t/string.rb
+2
-2
No files found.
mrblib/string.rb
View file @
3b76aae4
...
@@ -135,7 +135,7 @@ class String
...
@@ -135,7 +135,7 @@ class String
end
end
##
##
# ISO 15.2.10.5.
5
# ISO 15.2.10.5.
3
def
=~
(
re
)
def
=~
(
re
)
if
re
.
respond_to?
:to_str
if
re
.
respond_to?
:to_str
raise
TypeError
,
"type mismatch: String given"
raise
TypeError
,
"type mismatch: String given"
...
...
test/t/string.rb
View file @
3b76aae4
...
@@ -28,6 +28,8 @@ assert('String#==', '15.2.10.5.2') do
...
@@ -28,6 +28,8 @@ assert('String#==', '15.2.10.5.2') do
assert_not_equal
'abc'
,
'cba'
assert_not_equal
'abc'
,
'cba'
end
end
# 'String#=~', '15.2.10.5.3' will be tested in mrbgems.
assert
(
'String#+'
,
'15.2.10.5.4'
)
do
assert
(
'String#+'
,
'15.2.10.5.4'
)
do
assert_equal
'ab'
,
'a'
+
'b'
assert_equal
'ab'
,
'a'
+
'b'
end
end
...
@@ -36,8 +38,6 @@ assert('String#*', '15.2.10.5.5') do
...
@@ -36,8 +38,6 @@ assert('String#*', '15.2.10.5.5') do
assert_equal
'aaaaa'
,
'a'
*
5
assert_equal
'aaaaa'
,
'a'
*
5
end
end
# 'String#=~', '15.2.10.5.5' will be tested in mrbgems.
assert
(
'String#[]'
,
'15.2.10.5.6'
)
do
assert
(
'String#[]'
,
'15.2.10.5.6'
)
do
# length of args is 1
# length of args is 1
a
=
'abc'
[
0
]
a
=
'abc'
[
0
]
...
...
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