Schematron/Test.pm

filter: Statementstmt 26.0% 6 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 0.0% 0 / 1 totaltotal 24.1% 7 / 29 CC 2 SCAR 13.2
CC
2
Cov
24%
as_xsl
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 3.8
« Schematron/XSLTProcessor.pm ↑ Summary Schematron.pm »
1 package XML::Schematron::Test;
2 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3
4 1 has [qw|expression context message test_type|] => (
5 traits => ['String'],
6 is => 'rw',
7 isa => 'Str',
8 required => 1,
9 );
10
11 has pattern => (
12 is => 'ro',
13 isa => 'Maybe[Str]',
14 0 ▶ default => sub { '[none]' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
15 1 );
16
17 0 ▶sub as_xsl {
Subroutine as_xsl: not called CC=2 SCAR=17.9
Pod undocumented
18 0 my $self = shift;
19 0 my $priority = shift;
20
21 0 my $context = $self->context;
22 0 my $expression = $self->expression;
23 0 my $message = $self->message;
24
25 0 $context =~ s/"/'/g;
26 0 $expression =~ s/</&lt;/g;
27 0 $expression =~ s/>/&gt;/g;
28 0 $message =~ s/\n//g;
29 0 $message =~ s/^[ \t]+|[ \t]+$//;
30 0 $message .= "\n";
31
32 0 my $buffer;
33 0 ▶ if ( $self->test_type eq 'assert' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->test_type eq 'assert') { } 0 0 0
34 0 $buffer = sprintf(qq|<xsl:choose><xsl:when test="%s"/><xsl:otherwise>In pattern %s: %s</xsl:otherwise></xsl:choose>|, $expression, $self->pattern, $message)
35 }
36 else {
37 0 $buffer = sprintf(qq|<xsl:if test="%s">In pattern %s: %s</xsl:if>|, $expression, $self->pattern, $message);
38 }
39
40 0 return $buffer;
41 }
42
43 1 1;
« Schematron/XSLTProcessor.pm ↑ Summary Schematron.pm »