diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-12 09:24:13 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-12 09:24:13 +0000 |
commit | b2e399636a51eeef995f737c32fef853869ed696 (patch) | |
tree | df631f8c7545279ace105248ea9cf5216f54d72f /yarvtest/test_eval.rb | |
parent | ab2119fc3d61a7504d836cfb0231b736c1c33742 (diff) | |
download | ruby-b2e399636a51eeef995f737c32fef853869ed696.tar.gz |
* yarvtest: removed because it's outdated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvtest/test_eval.rb')
-rw-r--r-- | yarvtest/test_eval.rb | 221 |
1 files changed, 0 insertions, 221 deletions
diff --git a/yarvtest/test_eval.rb b/yarvtest/test_eval.rb deleted file mode 100644 index 0432caa3f1..0000000000 --- a/yarvtest/test_eval.rb +++ /dev/null @@ -1,221 +0,0 @@ -require 'yarvtest/yarvtest' - -class TestEval < YarvTestBase - def test_eval - ae %q{ - eval('1') - } - ae %q{ - eval('a=1; a') - } - ae %q{ - a = 1 - eval('a') - } - end - - def test_eval_with_send - ae %q{ - __send__ :eval, %{ - :ok - } - } - ae %q{ - 1.__send__ :instance_eval, %{ - :ok - } - } - end - - def test_module_eval - ae %q{ - Const = :top - class C - Const = :C - end - C.module_eval{ - Const - } - } - ae %q{ - Const = :top - class C - Const = :C - end - C.module_eval %{ - Const - } - } if false # TODO: Ruby 1.9 error - - ae %q{ - Const = :top - class C - Const = :C - end - C.class_eval %{ - def m - Const - end - } - C.new.m - } - ae %q{ - Const = :top - class C - Const = :C - end - C.class_eval{ - def m - Const - end - } - C.new.m - } - end - - def test_instance_eval - ae %q{ - 1.instance_eval{ - self - } - } - ae %q{ - 'foo'.instance_eval{ - self - } - } - ae %q{ - class Fixnum - Const = 1 - end - 1.instance_eval %{ - Const - } - } - end - - def test_nest_eval - ae %q{ - Const = :top - class C - Const = :C - end - $nest = false - $ans = [] - def m - $ans << Const - C.module_eval %{ - $ans << Const - Boo = false unless defined? Boo - unless $nest - $nest = true - m - end - } - end - m - $ans - } - ae %q{ - $nested = false - $ans = [] - $pr = proc{ - $ans << self - unless $nested - $nested = true - $pr.call - end - } - class C - def initialize &b - 10.instance_eval(&b) - end - end - C.new(&$pr) - $ans - } - end - - def test_binding - ae %q{ - def m - a = :ok - $b = binding - end - m - eval('a', $b) - } - ae %q{ - def m - a = :ok - $b = binding - end - m - eval('b = :ok2', $b) - eval('[a, b]', $b) - } - ae %q{ - $ans = [] - def m - $b = binding - end - m - $ans << eval(%q{ - $ans << eval(%q{ - a - }, $b) - a = 1 - }, $b) - $ans - } - ae %q{ - Const = :top - class C - Const = :C - def m - binding - end - end - eval('Const', C.new.m) - } - ae %q{ - Const = :top - a = 1 - class C - Const = :C - def m - eval('Const', TOPLEVEL_BINDING) - end - end - C.new.m - } - ae %q{ - class C - $b = binding - end - eval %q{ - def m - :ok - end - }, $b - p C.new.m - } - ae %q{ - b = proc{ - a = :ok - binding - }.call - a = :ng - eval("a", b) - } - ae %q{ - class C - def foo - binding - end - end - C.new.foo.eval("self.class.to_s") - } - end -end - |