diff options
Diffstat (limited to 'sample/test.rb')
-rw-r--r-- | sample/test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb index 912f84e2d4..b3303959f2 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -653,7 +653,6 @@ ok(!defined?(iii)) # out of scope $x=0 $proc.call(5) $proc2.call -p $x ok($x == 5) if defined? Process.kill @@ -739,6 +738,17 @@ rescue NameError # must raise error end ok(!$bad) +x = proc{} +eval "i = 1", x +ok(eval("i", x) == 1) +x = proc{proc{}}.call +eval "i = 22", x +ok(eval("i", x) == 22) +$x = [] +x = proc{proc{}}.call +eval "(0..9).each{|i4| $x[i4] = proc{i4*2}}", x +ok($x[4].call == 8) + check "system" ok(`echo foobar` == "foobar\n") ok(`./ruby -e 'print "foobar"'` == 'foobar') |