File Coverage

blib/lib/Markdent/Types/Internal.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Markdent::Types::Internal;
2              
3 35     35   265 use strict;
  35         114  
  35         1103  
4 35     35   194 use warnings;
  35         85  
  35         1688  
5              
6             our $VERSION = '0.40';
7              
8 35     35   19572 use IO::Handle;
  35         216088  
  35         1852  
9              
10 35     35   20894 use Specio::Declare;
  35         1829223  
  35         298  
11 35     35   27144 use Specio::Library::Builtins;
  35         892937  
  35         562  
12              
13 35     35   336448 use parent 'Specio::Exporter';
  35         112  
  35         326  
14              
15             declare(
16             'HeaderLevel',
17             parent => t('Int'),
18             inline => sub {"$_[1] >= 1 && $_[1] <= 6"},
19             message_generator =>
20             sub {"Header level must be a number from 1-6 (not $_)"},
21             );
22              
23             object_does_type(
24             'BlockParserDialectRole',
25             role => 'Markdent::Role::Dialect::BlockParser',
26             );
27              
28             declare(
29             'BlockParserClass',
30             parent => t('ClassName'),
31             inline => sub {
32             "$_[1]->can('does') && $_[1]->does('Markdent::Role::BlockParser')";
33             },
34             );
35              
36             object_does_type(
37             'SpanParserDialectRole',
38             role => 'Markdent::Role::Dialect::SpanParser',
39             );
40              
41             declare(
42             'SpanParserClass',
43             parent => t('ClassName'),
44             inline => sub {
45             "$_[1]->can('does') && $_[1]->does('Markdent::Role::SpanParser')";
46             },
47             );
48              
49             object_does_type(
50             'EventObject',
51             role => 'Markdent::Role::Event',
52             );
53              
54             declare(
55             'ExistingFile',
56             parent => t('Str'),
57             inline => sub {"$_[1] eq '-' || -f $_[1]"},
58             );
59              
60             object_does_type(
61             'HandlerObject',
62             role => 'Markdent::Role::Handler',
63             );
64              
65             declare(
66             'NonEmptyArrayRef',
67             parent => t('ArrayRef'),
68             inline => sub {"@{$_[1]} >= 1"},
69             );
70              
71             declare(
72             'OutputStream',
73             parent => t('Item'),
74             inline => sub {
75             sprintf(
76             <<'EOF', t('FileHandle')->inline_check( $_[1] ), t('Object')->inline_check( $_[1] ), $_[1] );
77             ( %s || %s ) && %s->can('print')
78             EOF
79             },
80             message_generator => sub {
81             'The output stream must be a Perl file handle or an object with a print method';
82             },
83             );
84              
85             enum(
86             'TableCellAlignment',
87             values => [qw( left right center )],
88             );
89              
90             1;