Lines Matching refs:got

134 my $got = timethis($iterations, sub {++$foo});
136 isa_ok($got, 'Benchmark', "timethis CODEREF");
139 $got = $out->read();
140 like ($got, qr/^timethis $iterations/, 'default title');
141 like ($got, $Default_Pattern, 'default format is all or noc');
145 $got = timethis($iterations, '++$bar');
147 isa_ok($got, 'Benchmark', "timethis eval");
150 $got = $out->read();
151 like ($got, qr/^timethis $iterations/, 'default title');
152 like ($got, $Default_Pattern, 'default format is all or noc');
157 $got = timethis($iterations, sub {++$foo}, $title);
159 isa_ok($got, 'Benchmark', "timethis with title");
162 $got = $out->read();
163 like ($got, qr/^$title:/, 'specify title');
164 like ($got, $Default_Pattern, 'default format is all or noc');
169 $got = timethis($iterations, sub {++$foo}, $title, 'nop');
171 isa_ok($got, 'Benchmark', "timethis with format");
174 $got = $out->read();
175 like ($got, qr/^$title:/, 'specify title');
176 like ($got, $Nop_Pattern, 'specify format as nop');
182 $got = timethis(-2, sub {$foo+= fib($ballast)}, $title, 'none');
185 isa_ok($got, 'Benchmark',
190 $got = $out->read();
192 $got =~ s/\(warning:[^\)]+\)//gs;
193 $got =~ s/^[ \t\n]+//s; # Remove all the whitespace from the beginning
195 is ($got, '', "format 'none' should suppress output");
200 $got = timethese($iterations, { Foo => sub {++$foo}, Bar => '++$bar',
203 is(ref ($got), 'HASH', "timethese should return a hashref");
204 isa_ok($got->{Foo}, 'Benchmark', "Foo value");
205 isa_ok($got->{Bar}, 'Benchmark', "Bar value");
206 isa_ok($got->{Baz}, 'Benchmark', "Baz value");
207 eq_set([keys %$got], [qw(Foo Bar Baz)], 'should be exactly three objects');
212 $got = $out->read();
214 $got =~ s/\(warning:[^\)]+\)//gs;
216 like ($got, qr/timing $iterations iterations of\s+Bar\W+Baz\W+Foo\W*?\.\.\./s,
219 $got =~ s/.*\.\.\.//s;
220 like ($got, qr/\bBar\b.*\bBaz\b.*\bFoo\b/s, 'check output is in sorted order');
221 like ($got, $Default_Pattern, 'should find default format somewhere');
279 $got = $out->read();
281 $got =~ s/\(warning:[^\)]+\)//gs;
282 is ($got =~ tr/ \t\n//c, 0, "format 'none' should suppress output");
354 my ($chart, $got) = @_;
358 = $got =~ $graph_dissassembly;
369 print STDERR "# Something went wrong there. I got this chart:\n";
370 print STDERR "# $_\n" foreach split /\n/, $got;
391 $got = $out->read();
393 $got =~ s/\(warning:[^\)]+\)//gs;
395 like ($got, qr/running\W+a\W+b.*?for at least 0\.1 CPU second/s,
398 $got =~ s/.*\.\.\.//s;
399 like ($got, $Default_Pattern, 'should find default format somewhere');
400 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
401 check_graph_vs_output ($chart, $got);
413 $got = $out->read();
415 $got =~ s/\(warning:[^\)]+\)//gs;
417 unlike ($got, qr/running\W+a\W+b.*?for at least 0\.1 CPU second/s,
420 $got =~ s/.*\.\.\.//s;
421 unlike ($got, $Default_Pattern, 'should not find default format somewhere');
422 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
423 check_graph_vs_output ($chart, $got);
434 $got = $out->read();
436 $got =~ s/\(warning:[^\)]+\)//gs;
437 like ($got, qr/timing 10 iterations of\s+Bar\W+Foo\W*?\.\.\./s,
440 $got =~ s/.*\.\.\.//s;
441 like ($got, $Nop_Pattern, 'specify format as nop');
442 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
443 check_graph_vs_output ($chart, $got);
454 $got = $out->read();
456 $got =~ s/\(warning:[^\)]+\)//gs;
457 $got =~ s/^[ \t\n]+//s; # Remove all the whitespace from the beginning
458 is ($got, '', "format 'none' should suppress output");
474 $got = $out->read();
475 ok ($got !~ /\.\.\./s, 'check that there is no title');
476 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
477 check_graph_vs_output ($chart, $got);
488 $got = $out->read();
489 is ($got, '', "'none' should suppress all output");
497 ###}my $out = tie *OUT, 'TieOut'; my ($got); ###
510 $got = timeit(5, '++$bar');
512 isa_ok($got, 'Benchmark', "timeit eval");