mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1653 from iij/pr-fix-iso-ref-string-match
fix ISO reference number of String#=~.
This commit is contained in:
+1
-1
@@ -135,7 +135,7 @@ class String
|
||||
end
|
||||
|
||||
##
|
||||
# ISO 15.2.10.5.5
|
||||
# ISO 15.2.10.5.3
|
||||
def =~(re)
|
||||
if re.respond_to? :to_str
|
||||
raise TypeError, "type mismatch: String given"
|
||||
|
||||
+2
-2
@@ -28,6 +28,8 @@ assert('String#==', '15.2.10.5.2') do
|
||||
assert_not_equal 'abc', 'cba'
|
||||
end
|
||||
|
||||
# 'String#=~', '15.2.10.5.3' will be tested in mrbgems.
|
||||
|
||||
assert('String#+', '15.2.10.5.4') do
|
||||
assert_equal 'ab', 'a' + 'b'
|
||||
end
|
||||
@@ -36,8 +38,6 @@ assert('String#*', '15.2.10.5.5') do
|
||||
assert_equal 'aaaaa', 'a' * 5
|
||||
end
|
||||
|
||||
# 'String#=~', '15.2.10.5.5' will be tested in mrbgems.
|
||||
|
||||
assert('String#[]', '15.2.10.5.6') do
|
||||
# length of args is 1
|
||||
a = 'abc'[0]
|
||||
|
||||
Reference in New Issue
Block a user