summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 07:45:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-30 07:45:42 +0000
commitb8b083dbd5444007645a667dcb9d7a30e1e44b0b (patch)
treef959c46536a279ad5306a5ecc8a78b7710a81b15 /test/ruby
parentd919a67c1e704ba7c7f0067ec649c98288a662fe (diff)
* 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/ruby')
-rw-r--r--test/ruby/test_class.rb7
-rw-r--r--test/ruby/test_module.rb8
2 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 93a19e8..bc0f79a 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 066dd86..4611abf 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