line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package OOP::Perlish::Class::UnitTests::TestEmit; |
3
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
6
|
use Test::Class; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
6
|
1
|
|
|
1
|
|
1311
|
use Test::More; |
|
1
|
|
|
|
|
7891
|
|
|
1
|
|
|
|
|
13
|
|
7
|
1
|
|
|
1
|
|
1182
|
use OOP::Perlish::Class::UnitTests::Base; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
102
|
|
8
|
1
|
|
|
1
|
|
15
|
use base qw(OOP::Perlish::Class::UnitTests::Base); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
264
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub setup : Test(setup) |
11
|
|
|
|
|
|
|
{ |
12
|
7
|
|
|
7
|
0
|
5905
|
my ($self) = @_; |
13
|
|
|
|
|
|
|
|
14
|
7
|
|
|
|
|
56
|
$self->{obj} = OOP::Perlish::Class::UnitTests::Baz::Foo::Bar->new( bar => 'bar' ); |
15
|
|
|
|
|
|
|
|
16
|
7
|
|
|
|
|
148
|
$self->{obj}->_emitlevel(9); |
17
|
7
|
|
|
|
|
15
|
$self->{string} = ''; |
18
|
|
|
|
|
|
|
|
19
|
7
|
|
|
|
|
24
|
close STDERR; |
20
|
7
|
|
|
1
|
|
103
|
open(STDERR, '>', \$self->{string} ); |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
21
|
1
|
|
|
1
|
|
6
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub test_emit |
24
|
|
|
|
|
|
|
{ |
25
|
6
|
|
|
6
|
0
|
12
|
my ($self, $level) = @_; |
26
|
|
|
|
|
|
|
|
27
|
6
|
|
|
|
|
53
|
$self->{obj}->$level('Hello world ' . $level); |
28
|
6
|
|
|
|
|
40
|
is($self->{string}, uc($level) . ': ' . 'Hello world ' . $level . $/, $level . ' output correctly'); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub testerror : Test(1) |
32
|
|
|
|
|
|
|
{ |
33
|
1
|
|
|
1
|
0
|
162
|
my ($self) = @_; |
34
|
1
|
|
|
|
|
6
|
$self->test_emit('error'); |
35
|
1
|
|
|
1
|
|
405
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub testwarning : Test(1) |
38
|
|
|
|
|
|
|
{ |
39
|
1
|
|
|
1
|
0
|
150
|
my ($self) = @_; |
40
|
1
|
|
|
|
|
4
|
$self->test_emit('warning'); |
41
|
1
|
|
|
1
|
|
233
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub testinfo : Test(1) |
44
|
|
|
|
|
|
|
{ |
45
|
1
|
|
|
1
|
0
|
157
|
my ($self) = @_; |
46
|
1
|
|
|
|
|
4
|
$self->test_emit('info'); |
47
|
1
|
|
|
1
|
|
245
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub testverbose : Test(1) |
50
|
|
|
|
|
|
|
{ |
51
|
1
|
|
|
1
|
0
|
181
|
my ($self) = @_; |
52
|
1
|
|
|
|
|
5
|
$self->test_emit('verbose'); |
53
|
1
|
|
|
1
|
|
181
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub testdebug : Test(1) |
56
|
|
|
|
|
|
|
{ |
57
|
1
|
|
|
1
|
0
|
1553
|
my ($self) = @_; |
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
|
|
9
|
$self->{obj}->debug('Hello world debug'); |
60
|
1
|
|
|
|
|
5
|
is($self->{string}, 'DEBUG0: ' . 'Hello world debug' . $/, 'debug output correctly'); |
61
|
1
|
|
|
1
|
|
313
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub testdebug1 : Test(1) |
64
|
|
|
|
|
|
|
{ |
65
|
1
|
|
|
1
|
0
|
140
|
my ($self) = @_; |
66
|
1
|
|
|
|
|
5
|
$self->test_emit('debug1'); |
67
|
1
|
|
|
1
|
|
247
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub testdebug2 : Test(1) |
70
|
|
|
|
|
|
|
{ |
71
|
1
|
|
|
1
|
0
|
153
|
my ($self) = @_; |
72
|
1
|
|
|
|
|
3
|
$self->test_emit('debug2'); |
73
|
1
|
|
|
1
|
|
241
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
=head1 NAME |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 VERSION |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 SYNOPSIS |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 METHODS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Jamie Beverly, C<< >> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 BUGS |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, |
91
|
|
|
|
|
|
|
or through |
92
|
|
|
|
|
|
|
the web interface at |
93
|
|
|
|
|
|
|
L. I will be |
94
|
|
|
|
|
|
|
notified, and then you'll |
95
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 SUPPORT |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
perldoc OOP::Perlish::Class |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
You can also look for information at: |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=over 4 |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
L |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
L |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * CPAN Ratings |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
L |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * Search CPAN |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
L |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=back |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Copyright 2009 Jamie Beverly |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
134
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
135
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |