summaryrefslogtreecommitdiff
path: root/test/ruby/test_method.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 11:18:12 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 11:18:12 +0000
commit56036e3514a5afa76c60b7850277da63c4de93b1 (patch)
treef3b991bb86959c17df34c631e2440727795e939f /test/ruby/test_method.rb
parent61086883b64312d8936fde7138d195e196d514a4 (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/trunk@27895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_method.rb')
-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