зеркало из https://github.com/github/ruby.git
test_settracefunc (test_tracepoint_enable_with_target_line): less fragile
Allow us to make other changes to the file and move the method around without affecting this test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
79dd244c3a
Коммит
e9dbafa5c8
|
@ -2059,6 +2059,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||
|
||||
def test_tracepoint_enable_with_target_line
|
||||
events = []
|
||||
line_0 = __LINE__
|
||||
code1 = proc{
|
||||
events << 1
|
||||
events << 2
|
||||
|
@ -2067,7 +2068,7 @@ class TestSetTraceFunc < Test::Unit::TestCase
|
|||
tp = TracePoint.new(:line) do |tp|
|
||||
events << :tp
|
||||
end
|
||||
tp.enable(target: code1, target_line: 2064) do
|
||||
tp.enable(target: code1, target_line: line_0 + 3) do
|
||||
code1.call
|
||||
end
|
||||
assert_equal [1, :tp, 2, 3], events
|
||||
|
|
Загрузка…
Ссылка в новой задаче