diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-30 07:45:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-30 07:45:42 +0000 |
commit | b8b083dbd5444007645a667dcb9d7a30e1e44b0b (patch) | |
tree | f959c46536a279ad5306a5ecc8a78b7710a81b15 /test | |
parent | d919a67c1e704ba7c7f0067ec649c98288a662fe (diff) | |
download | ruby-b8b083dbd5444007645a667dcb9d7a30e1e44b0b.tar.gz |
* insns.def (defineclass): preserve encoding of class/module
names. [ruby-core:24600]
* variable.c (rb_set_class_path_string): set class path with a
string value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_class.rb | 7 | ||||
-rw-r--r-- | test/ruby/test_module.rb | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 93a19e86e9..bc0f79a681 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -144,4 +144,11 @@ class TestClass < Test::Unit::TestCase assert_raise(TypeError) { Class.allocate.new } assert_raise(TypeError) { Class.allocate.superclass } end + + def test_nonascii_name + c = eval("class ::C\u{df}; self; end") + assert_equal("C\u{df}", c.name, '[ruby-core:24600]') + c = eval("class C\u{df}; self; end") + assert_equal("TestClass::C\u{df}", c.name, '[ruby-core:24600]') + end end diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 066dd86011..4611abfbfb 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -741,4 +741,12 @@ class TestModule < Test::Unit::TestCase assert_equal(:bClass2, b.__send__(:bClass2)) assert_equal(:bClass3, b.__send__(:bClass3)) end + + + def test_nonascii_name + c = eval("class ::C\u{df}; self; end") + assert_equal("C\u{df}", c.name, '[ruby-core:24600]') + c = eval("class C\u{df}; self; end") + assert_equal("TestModule::C\u{df}", c.name, '[ruby-core:24600]') + end end |