aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_class.rb5
-rw-r--r--test/ruby/test_module.rb5
2 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index efee102835..4f7e037580 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -529,5 +529,10 @@ class TestClass < Test::Unit::TestCase
assert_raise_with_message(TypeError, /is not a class/) {
m.module_eval "class A; end"
}
+ n = "M\u{1f5ff}"
+ m.module_eval "#{n} = 42"
+ assert_raise_with_message(TypeError, "#{n} is not a class") {
+ m.module_eval "class #{n}; end"
+ }
end
end
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index e91d2c8a93..5fc3d4a541 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -2072,6 +2072,11 @@ class TestModule < Test::Unit::TestCase
assert_raise_with_message(TypeError, /is not a module/) {
m.module_eval "module A; end"
}
+ n = "M\u{1f5ff}"
+ m.module_eval "#{n} = 42"
+ assert_raise_with_message(TypeError, "#{n} is not a module") {
+ m.module_eval "module #{n}; end"
+ }
end
private