diff options
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_module.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index ba6f273159..57a01db28e 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -651,6 +651,11 @@ class TestModule < Test::Unit::TestCase assert_raise(NameError) { c1.const_set(:foo, :foo) } assert_raise(NameError) { c1.const_set("bar", :foo) } assert_raise(TypeError) { c1.const_set(1, :foo) } + assert_nothing_raised(NameError) { c1.const_set("X\u{3042}", :foo) } + assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-16be"), :foo) } + assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-16le"), :foo) } + assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-32be"), :foo) } + assert_raise(NameError) { c1.const_set("X\u{3042}".encode("utf-32le"), :foo) } end def test_const_get_invalid_name |