Merge pull request #1653 from iij/pr-fix-iso-ref-string-match

fix ISO reference number of String#=~.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-01-09 22:03:29 -08:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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]