File Coverage

t/01.syntax.t
Criterion Covered Total %
statement 13 15 86.6
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 20 90.0


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2             #
3 1     1   5 use strict;
  1         2  
  1         34  
4 1     1   5 use warnings;
  1         1  
  1         27  
5              
6 1     1   969 use Test::More qw(no_plan);
  1         19376  
  1         8  
7              
8 1     1   1076 use lib qw(t/lib);
  1         686  
  1         6  
9 1     1   522 use IkiWiki q(2.0);
  0            
  0            
10              
11             use_ok( 'IkiWiki::Plugin::syntax' );
12              
13             my $text = <
14             #!perl -T
15              
16             use Test::More;
17             eval "use Test::Pod 1.14";
18             plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
19             all_pod_files_ok();
20             EOF
21              
22             # Setting global parameters
23             $IkiWiki::config{syntax_engine} = q(Simple);
24              
25             # Initialize the plugin
26             IkiWiki::Plugin::syntax::checkconfig();
27              
28             # Check syntax highlighting from a string
29             my $result = IkiWiki::Plugin::syntax::preprocess(
30             language => 'Perl',
31             description => 't/pod.t',
32             text => $text );
33              
34             ok($result, 'colorized perl syntax from string');
35              
36             $result = IkiWiki::Plugin::syntax::preprocess(
37             language => 'Perl',
38             description => 't/pod.t',
39             linenumbers => 1,
40             bars => 1,
41             text => $text );
42              
43             ok($result, 'colorized perl syntax from numered string');
44