summaryrefslogtreecommitdiff
path: root/test/ruby/test_settracefunc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_settracefunc.rb')
-rw-r--r--test/ruby/test_settracefunc.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 72e114398b..0c8d7399cc 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -383,7 +383,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
[["c-return", 3, :set_trace_func, Kernel],
["line", 6, __method__, self.class],
- ["call", 6, :foobar, FooBar],
+ ["call", 1, :foobar, FooBar],
["return", 6, :foobar, FooBar],
["line", 7, __method__, self.class],
["c-call", 7, :set_trace_func, Kernel]].each{|e|
@@ -1238,4 +1238,23 @@ class TestSetTraceFunc < Test::Unit::TestCase
trace.disable
end
end
+
+ define_method(:method_test_argument_error_on_bmethod){|correct_key: 1|}
+
+ def test_argument_error_on_bmethod
+ events = []
+ curr_thread = Thread.current
+ TracePoint.new(:call, :return){|tp|
+ next if curr_thread != Thread.current
+ events << [tp.event, tp.method_id]
+ }.enable do
+ begin
+ method_test_argument_error_on_bmethod(wrong_key: 2)
+ rescue => e
+ # ignore
+ end
+ end
+
+ assert_equal [], events # should be empty.
+ end
end