mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
string.c: preserve encoding of global variable
* string.c (rb_str_setter): preserve encoding of global variable name in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b58802a3c1
commit
25bab786cb
3 changed files with 11 additions and 1 deletions
|
@ -2056,6 +2056,11 @@ class TestString < Test::Unit::TestCase
|
|||
|
||||
def test_setter
|
||||
assert_raise(TypeError) { $/ = 1 }
|
||||
name = "\u{5206 884c}"
|
||||
assert_separately([], <<-"end;") # do
|
||||
alias $#{name} $/
|
||||
assert_raise_with_message(TypeError, /\\$#{name}/) { $#{name} = 1 }
|
||||
end;
|
||||
end
|
||||
|
||||
def test_to_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue