Skip to content

Commit

Permalink
Version 0.30
Browse files Browse the repository at this point in the history
Suppressing printing when run under -c.  This is to please B::Deparse.

Added very sparse EXAMPLES section.
  • Loading branch information
schwern committed Sep 28, 2001
1 parent b67da8a commit f335039
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Test/Builder.pm
Expand Up @@ -2,6 +2,10 @@ package Test::Builder;

use 5.004;

# $^C was only introduced in 5.005-ish. We do this to prevent
# use of uninitialized value warnings in older perls.
$^C ||= 0;

use strict;
use vars qw($VERSION $CLASS);
$VERSION = 0.01_01;
Expand Down Expand Up @@ -523,6 +527,9 @@ We encourage using this rather than calling print directly.
sub diag {
my($self, @msgs) = @_;

# Prevent printing headers when compiling (ie. -c)
return if $^C;

# Escape each line with a #.
foreach (@msgs) {
s/^([^#])/# $1/;
Expand Down Expand Up @@ -550,6 +557,10 @@ Prints to the output() filehandle.
sub _print {
my($self, @msgs) = @_;

# Prevent printing headers when only compiling. Mostly for when
# tests are deparsed with B::Deparse
return if $^C;

local($\, $", $,) = (undef, ' ', '');
my $fh = $self->output;
print $fh @msgs;
Expand Down Expand Up @@ -868,6 +879,9 @@ END {
$Test->_ending if defined $Test;
}

=head1 EXAMPLES
At this point, Test::Simple and Test::More are your best examples.
=head1 AUTHOR
Expand Down

0 comments on commit f335039

Please sign in to comment.