diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 10:56:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-08 10:56:14 +0000 |
commit | f47627e8a345860942490ca60cfb18f6820fa0f9 (patch) | |
tree | 4fa1b092f971cf48a10af796fcb443a82c89ca77 /test | |
parent | b500f3c9a5880b4ca0da3d358673d02e4952ce52 (diff) | |
download | ruby-f47627e8a345860942490ca60cfb18f6820fa0f9.tar.gz ruby-f47627e8a345860942490ca60cfb18f6820fa0f9.tar.xz ruby-f47627e8a345860942490ca60cfb18f6820fa0f9.zip |
merges r24321 from trunk into ruby_1_9_1.
--
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24450 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 | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 93a19e86e..bc0f79a68 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 e1f729963..ff74fc7f7 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -721,4 +721,11 @@ class TestModule < Test::Unit::TestCase }.call end 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 |