mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
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
This commit is contained in:
parent
d4ff516f33
commit
7f4dc81717
2 changed files with 6 additions and 1 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue