X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FLeaner.pm;h=7fe001a248b394eec4daa55d02b9fdbe95432190;hb=718844cc10b90e9ae4acc24a82539ea99c8a4cbb;hp=b629f6a8d93d377485e7303314be049fb1b4ed5e;hpb=0857b9585353fe0fe98e3e1fded50f6e15b3f1f3;p=perl%2Fmodules%2FTest-Leaner.git diff --git a/lib/Test/Leaner.pm b/lib/Test/Leaner.pm index b629f6a..7fe001a 100644 --- a/lib/Test/Leaner.pm +++ b/lib/Test/Leaner.pm @@ -106,7 +106,7 @@ sub croak { die @_, " at $file line $line.\n"; } -sub sanitize_comment { +sub _sanitize_comment { $_[0] =~ s/\n+\z//; $_[0] =~ s/#/\\#/g; $_[0] =~ s/\n/\n# /g; @@ -145,7 +145,7 @@ sub plan { $plan = SKIP_ALL; $plan_str = '1..0 # SKIP'; if (defined $value) { - sanitize_comment($value); + _sanitize_comment($value); $plan_str .= " $value" if length $value; } } else { @@ -237,7 +237,7 @@ sub skip { my $skip_str = "ok $test # skip"; if (defined $reason) { - sanitize_comment($reason); + _sanitize_comment($reason); $skip_str .= " $reason" if length $reason; } @@ -297,7 +297,7 @@ sub ok ($;$) { ++$failed; } if (defined $desc) { - sanitize_comment($desc); + _sanitize_comment($desc); $test_str .= " - $desc" if length $desc; } @@ -460,7 +460,7 @@ sub _diag_fh { return if $no_diag; my $msg = join '', map { defined($_) ? $_ : 'undef' } @_; - sanitize_comment($msg); + _sanitize_comment($msg); return unless length $msg; local $\; @@ -498,7 +498,7 @@ sub BAIL_OUT { my $bail_out_str = 'Bail out!'; if (defined $desc) { - sanitize_comment($desc); + _sanitize_comment($desc); $bail_out_str .= " $desc" if length $desc; # Two spaces } @@ -579,6 +579,11 @@ sub diag_stream (;*) { diag_stream *STDERR; +=head2 C + +This constant evaluates to true if and only if L is thread-safe, i.e. when this version of C is at least 5.8, has been compiled with C defined, and L has been loaded B L. +In that case, it also needs a working L. + =head1 DEPENDENCIES L 5.6.