File Coverage

t/08.preprocess.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         1  
  1         30  
4 1     1   3 use warnings;
  1         1  
  1         23  
5              
6 1     1   571 use lib qw(lib t/lib);
  1         555  
  1         4  
7              
8 1     1   1133 use Test::More qw(no_plan);
  1         16226  
  1         11  
9              
10 1     1   712 use IkiWiki;
  0            
  0            
11             use IkiWiki::Plugin::syntax;
12              
13             my $source = <
14             int i = 1;
15             int j = 2;
16              
17             sumar( i, j);
18              
19             int sumar( int a, int b)
20             {
21             return a + b;
22             }
23             EOF
24              
25             $IkiWiki::config{syntax_engine} = q(Kate);
26             IkiWiki::Plugin::syntax::checkconfig();
27              
28             eval {
29             my $output = IkiWiki::Plugin::syntax::preprocess(
30             engine => q(Kate),
31             language => q(c),
32             text => $source,
33             linenumbers => 1
34             );
35             };
36              
37             if ($@) {
38             fail("preprocess C source code");
39             }
40             else {
41             pass("preprocess C source code");
42             }
43