diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-19 18:47:56 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-19 18:47:56 +0000 |
| commit | ee65d7d76f19a16f0da0ed36e45afba4939524c4 (patch) | |
| tree | b22a65c2882e7408c924bc41f90d7c2c614c2460 /bootstraptest | |
| parent | 2fe6158b36d75bc92b14ab8a13f1c9ab0520b03e (diff) | |
| download | ruby-ee65d7d76f19a16f0da0ed36e45afba4939524c4.tar.gz ruby-ee65d7d76f19a16f0da0ed36e45afba4939524c4.tar.xz ruby-ee65d7d76f19a16f0da0ed36e45afba4939524c4.zip | |
* eval.c, vm_insnhelper.c: fix cref in instance_eval
and cvar_base search protocol.
* bootstraptest/test_knownbug.rb, test_eval.rb: move soleved test
and add new tests.
* test/ruby/test_eval.rb: fix tests for spec.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_eval.rb | 46 | ||||
| -rw-r--r-- | bootstraptest/test_knownbug.rb | 10 |
2 files changed, 46 insertions, 10 deletions
diff --git a/bootstraptest/test_eval.rb b/bootstraptest/test_eval.rb index 339e763f4..4c8e5aaa0 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]' diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index 9f1bbc8a4..5fb613650 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -91,16 +91,6 @@ assert_equal 'ok', %q{ }.call }, '[ruby-dev:34646]' -assert_equal 'ok', %q{ - begin - 0.instance_eval { def m() :m end } - 1.m - :ng - rescue Exception - :ok - end -}, '[ruby-dev:34579]' - assert_normal_exit %q{ eval("", method(:proc).call {}.binding) } |
