1 # frozen_string_literal: false
2 require_relative 'helper'
5 class TestArrayCreate < TestCase
7 trap_probe(probe, '[]') { |_,rbfile,saw|
8 saw = saw.map(&:split).find_all { |num, file, line|
9 file == rbfile && num == '0'
11 assert_equal([rbfile], saw.map { |line| line[1] })
12 assert_equal(['1'], saw.map { |line| line[2] })
17 trap_probe(probe, '[1,2,3,4]') { |_,rbfile,orig|
18 saw = orig.map(&:split).find_all { |num, file, line|
19 file == rbfile && num == '4' && line == '1'
21 assert_operator saw.length, :>, 0, orig
26 def probe type = 'array'
28 ruby$target:::#{type}-create
31 printf("%d %s %d\\n", arg0, copyinstr(arg1), arg2);
36 end if defined?(DTrace::TestCase)