diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2019-12-04 01:26:28 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2019-12-04 06:40:54 +0900 |
commit | 08074eb71229b4c9f669f7bfb215bbb43525bfc0 (patch) | |
tree | 506ba272f8a792ced96d945594335d83d2128114 /test | |
parent | a705f6472c3e34422776d886bbc9f98676d8c0eb (diff) |
Revert "Revert nil error and adding deprecation message"
This reverts commit 452bee3ee8d68059fabd9b1c7a75661b14e3933e.
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_regexp.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index a1d49c595a..d48eef5366 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_nil(//.match(nil)) + assert_raise(TypeError) { //.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)) |