summaryrefslogtreecommitdiff
path: root/bootstraptest/test_eval.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_eval.rb')
-rw-r--r--bootstraptest/test_eval.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb
index 339e763f46..4c8e5aaa09 100644
--- a/bootstraptest/test_eval.rb
+++ b/bootstraptest/test_eval.rb
@@ -236,3 +236,49 @@ assert_equal 'ok', %q{
:ok
end
}
+
+assert_equal 'ok', %q{
+ begin
+ 0.instance_eval { def m() :m end }
+ 1.m
+ :ng
+ rescue Exception
+ :ok
+ end
+}, '[ruby-dev:34579]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_eval { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ begin
+ 12.instance_exec { @@a }
+ rescue NameError
+ :ok
+ end
+}, '[ruby-core:16794]'
+
+assert_equal 'ok', %q{
+ begin
+ nil.instance_eval {
+ def a() :a end
+ }
+ rescue => TypeError
+ :ok
+ end
+}, '[ruby-core:16796]'
+
+assert_equal 'ok', %q{
+ begin
+ nil.instance_exec {
+ def a() :a end
+ }
+ rescue => TypeError
+ :ok
+ end
+}, '[ruby-core:16796]'