summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-19 12:23:57 (GMT)
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-19 12:23:57 (GMT)
commit02942a6b9056e0d52137d916a304788eddcd564f (patch)
tree3f55c3025247eb6b8b55fbeae686e749e2861d9a /test
parent2aabfcd4c604891ab043649129bb1404e3c311f0 (diff)
fix document of Regexp#match?
* re.c (rb_reg_match_m_p): [DOC] fix return value in rdoc. * test/ruby/test_regexp.rb (TestRegexp#test_match_p): add some tests from document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_regexp.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index c25433b..34466e0 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -543,6 +543,9 @@ class TestRegexp < Test::Unit::TestCase
assert_equal(true, /../n.match?("\u3042" + '\x', 1))
assert_equal(true, /\z/.match?(""))
assert_equal(true, /\z/.match?("abc"))
+ assert_equal(true, /R.../.match?("Ruby"))
+ assert_equal(false, /R.../.match?("Ruby", 1))
+ assert_equal(false, /P.../.match?("Ruby"))
assert_equal('backref', $&)
end