summaryrefslogtreecommitdiff
path: root/test/ruby/test_regexp.rb
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2019-12-04 01:26:29 +0900
committerNARUSE, Yui <naruse@airemix.jp>2019-12-04 06:40:54 +0900
commit8852fa876039ed177fd5e867f36177d8a9ff411c (patch)
tree56dd2c368bfe7cc694bf333c3ef987e2fee1b727 /test/ruby/test_regexp.rb
parent08074eb71229b4c9f669f7bfb215bbb43525bfc0 (diff)
Revert "Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)"
This reverts commit 2a22a6b2d8465934e75520a7fdcf522d50890caf. Revert [Feature #13083]
Diffstat (limited to 'test/ruby/test_regexp.rb')
-rw-r--r--test/ruby/test_regexp.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index d48eef5366..a1d49c595a 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -539,7 +539,7 @@ class TestRegexp < Test::Unit::TestCase
end
def test_match
- assert_raise(TypeError) { //.match(nil) }
+ assert_nil(//.match(nil))
assert_equal("abc", /.../.match(:abc)[0])
assert_raise(TypeError) { /.../.match(Object.new)[0] }
assert_equal("bc", /../.match('abc', 1)[0])
@@ -561,10 +561,10 @@ class TestRegexp < Test::Unit::TestCase
/backref/ =~ 'backref'
# must match here, but not in a separate method, e.g., assert_send,
# to check if $~ is affected or not.
+ assert_equal(false, //.match?(nil))
assert_equal(true, //.match?(""))
assert_equal(true, /.../.match?(:abc))
assert_raise(TypeError) { /.../.match?(Object.new) }
- assert_raise(TypeError) { //.match?(nil) }
assert_equal(true, /b/.match?('abc'))
assert_equal(true, /b/.match?('abc', 1))
assert_equal(true, /../.match?('abc', 1))