diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-28 17:06:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-28 17:06:59 +0000 |
commit | 491ace2dbebcba5e6f36b9e877c585823fd583f1 (patch) | |
tree | 4aa082d64367ae2005f212fcc10bf3cb3843ba2c /test | |
parent | 3ed6f43b96de41f57edbb4c935f58342b12996f5 (diff) | |
download | bundler-491ace2dbebcba5e6f36b9e877c585823fd583f1.tar.gz |
insns.def: preserve encoding
* insns.def (defineclass): preserve encoding of name in error
messages when already defined but type mismatch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_class.rb | 5 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index efee102835..4f7e037580 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -529,5 +529,10 @@ class TestClass < Test::Unit::TestCase assert_raise_with_message(TypeError, /is not a class/) { m.module_eval "class A; end" } + n = "M\u{1f5ff}" + m.module_eval "#{n} = 42" + assert_raise_with_message(TypeError, "#{n} is not a class") { + m.module_eval "class #{n}; end" + } end end diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index e91d2c8a93..5fc3d4a541 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -2072,6 +2072,11 @@ class TestModule < Test::Unit::TestCase assert_raise_with_message(TypeError, /is not a module/) { m.module_eval "module A; end" } + n = "M\u{1f5ff}" + m.module_eval "#{n} = 42" + assert_raise_with_message(TypeError, "#{n} is not a module") { + m.module_eval "module #{n}; end" + } end private |