summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--re.c2
-rw-r--r--test/ruby/test_regexp.rb3
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 73ea253e14..7297bca094 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu May 19 21:21:57 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
+
+ * 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.
+
Thu May 19 13:22:44 2016 Kazuki Yamaguchi <k@rhe.jp>
* ext/openssl/ossl.c (Init_openssl): register an ex_data index for
diff --git a/re.c b/re.c
index 01d28aa177..2eb42bc470 100644
--- a/re.c
+++ b/re.c
@@ -3214,7 +3214,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
* to begin the search.
*
* /R.../.match?("Ruby") #=> true
- * /R.../.match?("Ruby", 1) #=> true
+ * /R.../.match?("Ruby", 1) #=> false
* /P.../.match?("Ruby") #=> false
* $& #=> nil
*/
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index c25433b1ff..34466e0262 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