mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
re.c: do not escape terminator in Regexp.union
* re.c (rb_reg_str_with_term): change terminator. * re.c (rb_reg_s_union): terminator in source string does not need to be escaped. terminators are outside of regexp source itself. [ruby-core:86149] [Bug #14608] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0eddedbf5c
commit
8a8f542c43
2 changed files with 24 additions and 12 deletions
|
@ -90,6 +90,11 @@ class TestRegexp < Test::Unit::TestCase
|
|||
rescue ArgumentError
|
||||
:ok
|
||||
end
|
||||
re = Regexp.union(/\//, "")
|
||||
re2 = eval(re.inspect)
|
||||
assert_equal(re.to_s, re2.to_s)
|
||||
assert_equal(re.source, re2.source)
|
||||
assert_equal(re, re2)
|
||||
end
|
||||
|
||||
def test_word_boundary
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue