diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-19 02:37:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-19 02:37:38 +0000 |
commit | 780c056dadf26effeedaacf3e8a40576e0f91b77 (patch) | |
tree | 0d29f8513f148ff9e2aaddabb7869d519d40ff62 /test/ruby | |
parent | c2dc6960674c81fb4f0a8279f3470284bc0c740c (diff) | |
download | ruby-780c056dadf26effeedaacf3e8a40576e0f91b77.tar.gz |
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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_regexp.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |