summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 11:30:53 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 11:30:53 +0000
commit621b15ced94ebf5053bee4c0687ad88fe5b6b49e (patch)
treef492ceef09fa7b92db633a7058401e897e71cb41 /test
parent0aef6008919ef95df08b5a9a65fc059236241ebf (diff)
* vm_eval.c (rb_f_caller): return [] instead of nil when the function
is called on toplevel. [ruby-dev:41348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_method.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_method.rb b/test/ruby/test_method.rb
index ddeb6d6c87..86ab64feb1 100644
--- a/test/ruby/test_method.rb
+++ b/test/ruby/test_method.rb
@@ -228,6 +228,10 @@ class TestMethod < Test::Unit::TestCase
assert_in_out_err([], "p __callee__", %w(nil), [])
end
+ def test_caller_top_level
+ assert_in_out_err([], "p caller", %w([]), [])
+ end
+
def test_caller_negative_level
assert_raise(ArgumentError) { caller(-1) }
end