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 | 34889ca91f341e98dfde13568da06c4286ecb247 (patch) | |
tree | 2d9a4d22717157fc83b524fb42719626b3a39991 /test | |
parent | 33ce5b496ef807a254e51679d4770fa0b09766f3 (diff) | |
download | ruby-34889ca91f341e98dfde13568da06c4286ecb247.tar.gz |
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! |