line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use Moose; |
2
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
3
|
|
|
|
|
|
|
has [qw|expression context message test_type|] => ( |
4
|
|
|
|
|
|
|
traits => ['String'], |
5
|
|
|
|
|
|
|
is => 'rw', |
6
|
|
|
|
|
|
|
isa => 'Str', |
7
|
|
|
|
|
|
|
required => 1, |
8
|
|
|
|
|
|
|
); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has pattern => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => 'Maybe[Str]', |
13
|
|
|
|
|
|
|
default => sub { '[none]' }, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $self = shift; |
17
|
|
|
|
|
|
|
my $priority = shift; |
18
|
0
|
|
|
0
|
0
|
|
|
19
|
0
|
|
|
|
|
|
my $context = $self->context; |
20
|
|
|
|
|
|
|
my $expression = $self->expression; |
21
|
0
|
|
|
|
|
|
my $message = $self->message; |
22
|
0
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$context =~ s/"/'/g; |
24
|
|
|
|
|
|
|
$expression =~ s/</</g; |
25
|
0
|
|
|
|
|
|
$expression =~ s/>/>/g; |
26
|
0
|
|
|
|
|
|
$message =~ s/\n//g; |
27
|
0
|
|
|
|
|
|
$message =~ s/^[ \t]+|[ \t]+$//; |
28
|
0
|
|
|
|
|
|
$message .= "\n"; |
29
|
0
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $buffer; |
31
|
|
|
|
|
|
|
if ( $self->test_type eq 'assert' ) { |
32
|
0
|
|
|
|
|
|
$buffer = sprintf(qq|<xsl:choose><xsl:when test="%s"/><xsl:otherwise>In pattern %s: %s</xsl:otherwise></xsl:choose>|, $expression, $self->pattern, $message) |
33
|
0
|
0
|
|
|
|
|
} |
34
|
0
|
|
|
|
|
|
else { |
35
|
|
|
|
|
|
|
$buffer = sprintf(qq|<xsl:if test="%s">In pattern %s: %s</xsl:if>|, $expression, $self->pattern, $message); |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return $buffer; |
39
|
|
|
|
|
|
|
} |
40
|
0
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |