From f47627e8a345860942490ca60cfb18f6820fa0f9 Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 8 Aug 2009 10:56:14 +0000 Subject: 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 --- test/ruby/test_class.rb | 7 +++++++ test/ruby/test_module.rb | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'test/ruby') 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 -- cgit