From 780c056dadf26effeedaacf3e8a40576e0f91b77 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 19 May 2016 02:37:38 +0000 Subject: re.c: match? should return nil if no match * re.c (rb_reg_match_m_p): should return nil if no match, as the document says. [Feature #8110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_regexp.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/ruby/test_regexp.rb') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 4d534114da..8f5c9ceaa2 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -528,13 +528,13 @@ class TestRegexp < Test::Unit::TestCase def test_match_p /backref/ =~ 'backref' - assert_nil(//.match?(nil)) + assert_equal(false, //.match?(nil)) assert_equal(true, /.../.match?(:abc)) assert_raise(TypeError) { /.../.match?(Object.new) } assert_equal(true, /../.match?('abc', 1)) assert_equal(true, /../.match?('abc', -2)) - assert_nil(/../.match?("abc", -4)) - assert_nil(/../.match?("abc", 4)) + assert_equal(false, /../.match?("abc", -4)) + assert_equal(false, /../.match?("abc", 4)) assert_equal(true, /../n.match?("\u3042" + '\x', 1)) assert_equal('backref', $&) end -- cgit v1.2.3