diff --git a/test/dtrace/test_array_create.rb b/test/dtrace/test_array_create.rb index a7c4687f6f..1bf20085ba 100644 --- a/test/dtrace/test_array_create.rb +++ b/test/dtrace/test_array_create.rb @@ -14,11 +14,11 @@ module DTrace end def test_many_lit - trap_probe(probe, '[1,2,3,4]') { |_,rbfile,saw| - saw = saw.map(&:split).find_all { |num, file, line| + trap_probe(probe, '[1,2,3,4]') { |_,rbfile,orig| + saw = orig.map(&:split).find_all { |num, file, line| file == rbfile && num == '4' && line == '1' } - assert_operator saw.length, :>, 0 + assert_operator saw.length, :>, 0, orig } end diff --git a/test/dtrace/test_function_entry.rb b/test/dtrace/test_function_entry.rb index 2fac424fe4..0030560d54 100644 --- a/test/dtrace/test_function_entry.rb +++ b/test/dtrace/test_function_entry.rb @@ -17,7 +17,7 @@ ruby$target:::method-entry row.first == 'Foo' && row[1] == 'foo' } - assert_equal 10, foo_calls.length + assert_equal 10, foo_calls.length, probes line = '3' foo_calls.each { |f| assert_equal line, f[3] } foo_calls.each { |f| assert_equal rb_file, f[2] } @@ -38,7 +38,7 @@ ruby$target:::method-return row.first == 'Foo' && row[1] == 'foo' } - assert_equal 10, foo_calls.length + assert_equal 10, foo_calls.length, probes.inspect line = '3' foo_calls.each { |f| assert_equal line, f[3] } foo_calls.each { |f| assert_equal rb_file, f[2] } diff --git a/test/dtrace/test_hash_create.rb b/test/dtrace/test_hash_create.rb index 83a4d0062c..603ee21872 100644 --- a/test/dtrace/test_hash_create.rb +++ b/test/dtrace/test_hash_create.rb @@ -22,11 +22,11 @@ module DTrace end def test_hash_lit_elements - trap_probe(probe, '{ :foo => :bar }') { |_,rbfile,saw| - saw = saw.map(&:split).find_all { |num, file, line| + trap_probe(probe, '{ :foo => :bar }') { |_,rbfile,orig| + saw = orig.map(&:split).find_all { |num, file, line| file == rbfile && num == '2' } - assert_operator saw.length, :>, 0 + assert_operator saw.length, :>, 0, orig } end diff --git a/test/dtrace/test_singleton_function.rb b/test/dtrace/test_singleton_function.rb index a896b91975..ef1381a321 100644 --- a/test/dtrace/test_singleton_function.rb +++ b/test/dtrace/test_singleton_function.rb @@ -17,7 +17,7 @@ ruby$target:::method-entry row.first == 'Foo' && row[1] == 'foo' } - assert_equal 10, foo_calls.length + assert_equal 10, foo_calls.length, probes.inspect line = '3' foo_calls.each { |f| assert_equal line, f[3] } foo_calls.each { |f| assert_equal rb_file, f[2] } @@ -37,7 +37,7 @@ ruby$target:::method-return row.first == 'Foo' && row[1] == 'foo' } - assert_equal 10, foo_calls.length + assert_equal 10, foo_calls.length, probes.inspect line = '3' foo_calls.each { |f| assert_equal line, f[3] } foo_calls.each { |f| assert_equal rb_file, f[2] } diff --git a/test/dtrace/test_string.rb b/test/dtrace/test_string.rb index 407280b1fc..a72f989f63 100644 --- a/test/dtrace/test_string.rb +++ b/test/dtrace/test_string.rb @@ -4,11 +4,11 @@ require_relative 'helper' module DTrace class TestStringProbes < TestCase def test_object_create_start_string_lit - trap_probe(probe, '"omglolwutbbq"') { |_,rbfile,saw| - saw = saw.map(&:split).find_all { |klass, file, line, len| + trap_probe(probe, '"omglolwutbbq"') { |_,rbfile,orig| + saw = orig.map(&:split).find_all { |klass, file, line, len| file == rbfile && len == '12' && line == '1' } - assert_equal(%w{ String }, saw.map(&:first)) + assert_equal(%w{ String }, saw.map(&:first), orig.inspect) assert_equal([rbfile], saw.map { |line| line[1] }) assert_equal(['1'], saw.map { |line| line[2] }) }