diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-21 16:09:09 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-21 16:09:09 +0000 |
commit | 782fd488d7abc7ccb0c8072349182ea8beb902f0 () | |
tree | ce4bc612b7189cce8d7a2b3bab8b0d8b27b638b1 /test/ruby/test_regexp.rb | |
parent | 826f2ee3067176c65d079039e8dd7c57c74ba66b (diff) |
* regparse.c (fetch_name_with_level): allow non word characters
at the first character. [Feature #11949] * regparse.c (fetch_name): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_regexp.rb | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -142,6 +142,8 @@ class TestRegexp < Test::Unit::TestCase assert_equal("a[b]c", "abc".sub(/(?<x>[bc])/, "[\\k<x>]")) assert_equal("o", "foo"[/(?<bar>o)/, "bar"]) s = "foo" s[/(?<bar>o)/, "bar"] = "baz" @@ -175,6 +177,7 @@ class TestRegexp < Test::Unit::TestCase def test_assign_named_capture assert_equal("a", eval('/(?<foo>.)/ =~ "a"; foo')) assert_equal("a", eval('foo = 1; /(?<foo>.)/ =~ "a"; foo')) assert_equal("a", eval('1.times {|foo| /(?<foo>.)/ =~ "a"; break foo }')) assert_nothing_raised { eval('/(?<Foo>.)/ =~ "a"') } @@ -939,6 +942,10 @@ class TestRegexp < Test::Unit::TestCase h = {a => 42} assert_equal(42, h[b], '[ruby-core:24748]') assert_match(/#<TestRegexp::MatchData_\u{3042}:/, MatchData_A.allocate.inspect) end def test_regexp_poped |