diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-23 17:03:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-23 17:03:48 +0000 |
commit | 25bab786cb416aa491ff62e6d9b6ba196251bfc6 (patch) | |
tree | f36188efb63432fac183d7ac18ab3c3b7968a8f1 /test/ruby/test_string.rb | |
parent | b58802a3c145f9bade0bb31c759f090d3fba46c9 (diff) | |
download | ruby-25bab786cb416aa491ff62e6d9b6ba196251bfc6.tar.gz |
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
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index c0fd83e107..1285a1c120 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -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 |