diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 13:37:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-16 13:37:44 +0000 |
commit | 8a8f542c4366b5c23e1f607dd77f381e2bcbd5bc (patch) | |
tree | 120446b64d0eaeae2d5c0385633354bc76b09daf /test | |
parent | 0eddedbf5ca84bfbbaf124eb17bc1b0c39395680 (diff) |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_regexp.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index 90892355e5..990c157b52 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -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 |