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:
parent
7e5cb466d1
commit
1edaa8ac6a
1 changed files with 5 additions and 0 deletions
|
@ -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 & yyy")
|
||||
assert_equal("amp", m["foo"])
|
||||
|
|
Loading…
Reference in a new issue