diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-17 00:52:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-17 00:52:47 +0000 |
commit | 7f4dc81717b259e84d0d8eb7e7e937b692894e1f (patch) | |
tree | 2d9a4d22717157fc83b524fb42719626b3a39991 /test | |
parent | d4ff516f33342452c03900e5aa719b0da779e5c8 (diff) |
re.c: non-regexp name reference
* re.c (rb_reg_regsub): other than regexp has no name references.
[ruby-core:78686] [Bug #13042]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index d2fbd00a1d..4dee245462 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -1598,6 +1598,10 @@ CODE assert_equal(S("Abc"), S("abc").sub("a") {m = $~; "A"}) assert_equal(S("a"), m[0]) assert_equal(/a/, m.regexp) + bug = '[ruby-core:78686] [Bug #13042] other than regexp has no name references' + assert_raise_with_message(IndexError, /oops/, bug) { + 'hello'.gsub('hello', '\k<oops>') + } end def test_sub! |