Test-Group

 view release on metacpan or  search on metacpan

lib/Test/Group/Tester.pm  view on Meta::CPAN

C</> or compiled with C<qr//>.

Note that diagnostic lines consist of a hash character followed by a
space and then the diagnostic message. The strings and patterns passed
to want_test() must include this prefix.

=cut

sub want_test {
    my ($type, $name, @diag) = @_;
    my $call_line = (caller)[2];

    $type =~ /^(pass|fail|skip)\z/i or croak
          "want_test type=[$type], need pass|fail|skip";
    $type = lc $1;       

    # flatten diags to strings
    foreach my $diag (@diag) {
        ref $diag eq 'Regexp' and $diag = "/$diag";
        ref $diag and croak "unexpected reference diag [$diag] in want_test";
    }

lib/Test/Group/Tester.pm  view on Meta::CPAN

the diagnostic, false if the diagnostic will come from L<Test::Group>.
The expected text will be adjusted according to the version of
L<Test::Builder> or L<Test::Group> in use.

=cut

sub fail_diag {
    wantarray or croak "fail_diag needs a list context";

    my ($test_name, $from_test_builder, $line, $file) = @_;
    $file ||= (caller)[1];

    my @diag;

    if ($from_test_builder and $ENV{HARNESS_ACTIVE}) {
        # Test::Builder adds a blank diag line for a failed test
        # if HARNESS_ACTIVE is set.
        push @diag, '';
    }

    if ($from_test_builder and $Test::Builder::VERSION <= 0.30) {



( run in 1.618 second using v1.01-cache-2.11-cpan-a3c8064c92c )