File Coverage

blib/lib/Perlito/Test.pm
Criterion Covered Total %
statement 42 115 36.5
branch 1 10 10.0
condition n/a
subroutine 10 29 34.4
pod 0 21 0.0
total 53 175 30.2


line stmt bran cond sub pod time code
1             # Do not edit this file - Generated by Perlito 7.0
2 1     1   1503 use v5;
  1         15  
  1         59  
3 1     1   6 use utf8;
  1         3  
  1         8  
4 1     1   34 use strict;
  1         2  
  1         33  
5 1     1   7 use warnings;
  1         2  
  1         55  
6 1     1   7 no warnings ('redefine', 'once', 'void', 'uninitialized', 'misc', 'recursion');
  1         2  
  1         49  
7 1     1   7 use Perlito::Perl5::Runtime;
  1         2  
  1         30  
8 1     1   6 use Perlito::Perl5::Prelude;
  1         2  
  1         2066  
9             our $MATCH = Perlito::Match->new();
10             {
11             package GLOBAL;
12 0     0   0 sub new { shift; bless { @_ }, "GLOBAL" }
  0         0  
13             {
14             package Perlito::Test;
15 0     0 0 0 sub new { shift; bless { @_ }, "Perlito::Test" }
  0         0  
16             (my $num_of_tests_run);
17             (my $num_of_tests_failed);
18             (my $num_of_tests_badpass);
19             (my $num_of_tests_planned);
20             (my $testing_started);
21             sub plan {
22 1     1 0 9 my $number_of_tests = $_[0];
23 1         3 ($testing_started = 1);
24 1         2 ($num_of_tests_planned = $number_of_tests);
25 1         9 Main::say(('1..' . $number_of_tests))
26             };
27             sub ok {
28 1     1 0 6 my $cond = $_[0];
29 1         3 my $desc = $_[1];
30 1         2 my $todo = $_[2];
31 1         2 my $depends = $_[3];
32 1         7 Perlito::Test::proclaim($cond, ('ok' . chr(33) . ' ' . $desc), $todo, $depends)
33             };
34             sub is {
35 0     0 0 0 my $got = $_[0];
36 0         0 my $expected = $_[1];
37 0         0 my $desc = $_[2];
38 0         0 my $todo = $_[3];
39 0         0 my $depends = $_[4];
40 0         0 ((my $test) = ($got eq $expected));
41 0         0 Perlito::Test::proclaim($test, ('is' . chr(33) . ' ' . $desc), $todo, $got, $expected, $depends)
42             };
43             sub is_deeply {
44 0     0 0 0 my $got = $_[0];
45 0         0 my $expected = $_[1];
46 0         0 my $desc = $_[2];
47 0         0 my $todo = $_[3];
48 0         0 my $depends = $_[4];
49 0         0 ((my $got_perl) = Main::perl($got, ));
50 0         0 ((my $expected_perl) = Main::perl($expected, ));
51 0         0 ((my $test) = (($got_perl eq $expected_perl)));
52 0         0 Perlito::Test::proclaim($test, ('is deeply' . chr(33) . ' ' . $desc), $todo, $got_perl, $expected_perl, $depends)
53             };
54             sub isnt {
55 0     0 0 0 my $got = $_[0];
56 0         0 my $expected = $_[1];
57 0         0 my $desc = $_[2];
58 0         0 my $todo = $_[3];
59 0         0 my $depends = $_[4];
60 0         0 ((my $test) = !((($got eq $expected))));
61 0         0 Perlito::Test::proclaim($test, ('isnt' . chr(33) . ' ' . $desc), $todo, $got, $expected, $depends, do {
62 0         0 (my $Hash_a = bless {}, 'HASH');
63 0         0 ($Hash_a->{'negate'} = 1);
64 0         0 $Hash_a
65             })
66             };
67             sub cmp_ok {
68 0     0 0 0 my $got = $_[0];
69 0         0 my $Code_compare_func = $_[1];
70 0         0 my $expected = $_[2];
71 0         0 my $desc = $_[3];
72 0         0 my $todo = $_[4];
73 0         0 my $depends = $_[5];
74 0         0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::cmp_ok not implemented'))
75             };
76             sub like {
77 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::like not implemented'))
78             };
79             sub unlike {
80 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::unlike not implemented'))
81             };
82             sub eval_dies_ok {
83 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::eval_dies_ok not implemented'))
84             };
85             sub isa_ok {
86 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::isa_ok not implemented'))
87             };
88             sub use_ok {
89 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::use_ok not implemented'))
90             };
91             sub throws_ok {
92 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::throws_ok not implemented'))
93             };
94             sub dies_ok {
95 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::dies_ok not implemented'))
96             };
97             sub lives_ok {
98 0     0 0 0 Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::lives_ok not implemented'))
99             };
100             sub skip {
101 0     0 0 0 my $reason = $_[0];
102 0         0 my $depends = $_[1];
103 0         0 Perlito::Test::proclaim(1, '', ('skip ' . $reason), $depends)
104             };
105             sub pass {
106 0     0 0 0 my $desc = $_[0];
107 0         0 Perlito::Test::proclaim(1, ('pass' . chr(33) . ' ' . $desc))
108             };
109             sub flunk {
110 0     0 0 0 my $desc = $_[0];
111 0         0 my $todo = $_[1];
112 0         0 my $depends = $_[2];
113 0         0 Perlito::Test::proclaim(0, ('flunk' . chr(33) . ' ' . $desc), $todo, $depends)
114             };
115             sub proclaim {
116 1     1 0 3 my $cond = $_[0];
117 1         3 my $desc = $_[1];
118 1         2 my $todo = $_[2];
119 1         2 my $got = $_[3];
120 1         2 my $expected = $_[4];
121 1         3 my $depends = $_[5];
122 1         2 my $negate = $_[6];
123 1         3 ($testing_started = 1);
124 1         4 ($num_of_tests_run = ($num_of_tests_run + 1));
125 1 50       16 if (($cond)) {
126 1         5 Main::say(('ok '), $num_of_tests_run)
127             }
128             else {
129 0         0 Main::say(('not ok '), $num_of_tests_run);
130 0         0 Perlito::Test::report_failure($todo, $got, $expected, $negate)
131             };
132 1         7 return scalar ($cond)
133             };
134             sub report_failure {
135 0     0 0   my $todo = $_[0];
136 0           my $got = $_[1];
137 0           my $expected = $_[2];
138 0           my $negate = $_[3];
139 0           Main::say((chr(35) . chr(35) . chr(35) . ' Perlito::Test::report_failure not implemented'))
140             };
141             sub test_ends {
142 0 0   0 0   if ((!($testing_started))) {
143             return ()
144 0           };
145 0 0         if ((!($num_of_tests_planned))) {
146 0           Main::say(('1..' . $num_of_tests_run))
147             };
148 0 0         if ((($num_of_tests_planned != $num_of_tests_run))) {
149 0           Main::say((chr(35) . ' Looks like you planned ' . $num_of_tests_planned . (' tests, but ran ') . $num_of_tests_run))
150             };
151 0 0         if (($num_of_tests_failed)) {
152 0           Main::say((chr(35) . ' Looks like you failed ' . $num_of_tests_failed . (' tests of ') . $num_of_tests_run))
153             };
154 0           ($num_of_tests_run = 0);
155 0           ($num_of_tests_failed = 0);
156 0           ($num_of_tests_planned = 0);
157 0           ($testing_started = 0)
158             }
159             }
160              
161              
162             }
163              
164             1;