line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Pipe::Tester; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
576
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
5
|
1
|
|
|
1
|
|
500
|
use Text::Pipe; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
6
|
1
|
|
|
1
|
|
777
|
use Test::More; |
|
1
|
|
|
|
|
25
|
|
|
1
|
|
|
|
|
14
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
661
|
use base 'Exporter'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
346
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our @EXPORT = qw(pipe_ok); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub pipe_ok { |
20
|
13
|
|
|
13
|
1
|
4773
|
my ($type, $options, $input, $expect, $name) = @_; |
21
|
13
|
100
|
|
|
|
44
|
$name = $type unless defined $name; |
22
|
13
|
|
|
|
|
82
|
my $pipe = Text::Pipe->new($type, @$options); |
23
|
13
|
100
|
|
|
|
104
|
if (ref $expect eq 'ARRAY') { |
24
|
4
|
|
|
|
|
21
|
is_deeply($pipe->filter($input), $expect, $name); |
25
|
|
|
|
|
|
|
} else { |
26
|
9
|
|
|
|
|
33
|
is($pipe->filter($input), $expect, $name); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |