Lines Matching refs:got
234 my $got = timethis($iterations, sub {++$foo});
236 isa_ok($got, 'Benchmark', "timethis CODEREF");
239 $got = $out->read();
240 like ($got, qr/^timethis $iterations/, 'default title');
241 like ($got, $Default_Pattern, 'default format is all or noc');
245 $got = timethis($iterations, '++$bar');
247 isa_ok($got, 'Benchmark', "timethis eval");
250 $got = $out->read();
251 like ($got, qr/^timethis $iterations/, 'default title');
252 like ($got, $Default_Pattern, 'default format is all or noc');
257 $got = timethis($iterations, sub {++$foo}, $title);
259 isa_ok($got, 'Benchmark', "timethis with title");
262 $got = $out->read();
263 like ($got, qr/^$title:/, 'specify title');
264 like ($got, $Default_Pattern, 'default format is all or noc');
269 $got = timethis($iterations, sub {++$foo}, $title, 'nop');
271 isa_ok($got, 'Benchmark', "timethis with format");
274 $got = $out->read();
275 like ($got, qr/^$title:/, 'specify title');
276 like ($got, $Nop_Pattern, 'specify format as nop');
282 $got = timethis(-2, sub {$foo+= fib($ballast)}, $title, 'none');
285 isa_ok($got, 'Benchmark',
290 $got = $out->read();
292 $got =~ s/\(warning:[^\)]+\)//gs;
293 $got =~ s/^[ \t\n]+//s; # Remove all the whitespace from the beginning
295 is ($got, '', "format 'none' should suppress output");
300 $got = timethese($iterations, { Foo => sub {++$foo}, Bar => '++$bar',
303 is(ref ($got), 'HASH', "timethese should return a hashref");
304 isa_ok($got->{Foo}, 'Benchmark', "Foo value");
305 isa_ok($got->{Bar}, 'Benchmark', "Bar value");
306 isa_ok($got->{Baz}, 'Benchmark', "Baz value");
307 is_deeply([sort keys %$got], [sort qw(Foo Bar Baz)], 'should be exactly three objects');
312 $got = $out->read();
314 $got =~ s/\(warning:[^\)]+\)//gs;
316 like ($got, qr/timing $iterations iterations of\s+Bar\W+Baz\W+Foo\W*?\.\.\./s,
319 $got =~ s/.*\.\.\.//s;
320 like ($got, qr/\bBar\b.*\bBaz\b.*\bFoo\b/s, 'check output is in sorted order');
321 like ($got, $Default_Pattern, 'should find default format somewhere');
379 $got = $out->read();
381 $got =~ s/\(warning:[^\)]+\)//gs;
382 is ($got =~ tr/ \t\n//c, 0, "format 'none' should suppress output");
454 my ($chart, $got) = @_;
458 = $got =~ $graph_dissassembly;
469 diag("Something went wrong there. I got this chart:\n$got");
493 $got = $out->read();
495 $got =~ s/\(warning:[^\)]+\)//gs;
497 like ($got, qr/running\W+a\W+b.*?for at least 0\.1 CPU second/s,
500 $got =~ s/.*\.\.\.//s;
501 like ($got, $Default_Pattern, 'should find default format somewhere');
502 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
503 check_graph_vs_output ($chart, $got);
517 $got = $out->read();
519 $got =~ s/\(warning:[^\)]+\)//gs;
521 unlike ($got, qr/running\W+a\W+b.*?for at least 0\.1 CPU second/s,
524 $got =~ s/.*\.\.\.//s;
525 unlike ($got, $Default_Pattern, 'should not find default format somewhere');
526 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
527 check_graph_vs_output ($chart, $got);
538 $got = $out->read();
540 $got =~ s/\(warning:[^\)]+\)//gs;
541 like ($got, qr/timing $iterations iterations of\s+Bar\W+Foo\W*?\.\.\./s,
544 $got =~ s/.*\.\.\.//s;
545 like ($got, $Nop_Pattern, 'specify format as nop');
546 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
547 check_graph_vs_output ($chart, $got);
558 $got = $out->read();
560 $got =~ s/\(warning:[^\)]+\)//gs;
561 $got =~ s/^[ \t\n]+//s; # Remove all the whitespace from the beginning
562 is ($got, '', "format 'none' should suppress output");
582 $got = $out->read();
584 $got =~ s/\(warning:[^\)]+\)//gs;
585 $got =~ s/^[ \t\n]+//s; # Remove all the whitespace from the beginning
586 is ($got, '', "format 'none' should suppress output");
604 $got = $out->read();
605 unlike($got, qr/\.\.\./s, 'check that there is no title');
606 like ($got, $graph_dissassembly, "Should find the output graph somewhere");
607 check_graph_vs_output ($chart, $got);
618 $got = $out->read();
619 is ($got, '', "'none' should suppress all output");
640 $got = timeit(5, '++$bar');
642 isa_ok($got, 'Benchmark', "timeit eval");