1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add test for word boundary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-01-07 15:21:06 +00:00
parent 7e5cb466d1
commit 1edaa8ac6a

View file

@ -77,6 +77,11 @@ class TestRegexp < Test::Unit::TestCase
end
end
def test_word_boundary
assert_match(/\u3042\b /, "\u3042 ")
assert_not_match(/\u3042\ba/, "\u3042a")
end
def test_named_capture
m = /&(?<foo>.*?);/.match("aaa &amp; yyy")
assert_equal("amp", m["foo"])