summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 10:56:14 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 10:56:14 +0000
commit66b90d0f5c38ad4d8585cfc9e4d2ca923cc08539 (patch)
tree4fa1b092f971cf48a10af796fcb443a82c89ca77 /test
parent391fc1e8d9e1625c06c50e9f5b66d624e183200a (diff)
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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_class.rb7
-rw-r--r--test/ruby/test_module.rb7
2 files changed, 14 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 e1f7299636..ff74fc7f73 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