line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
2036
|
use 5.010001; |
|
4
|
|
|
|
|
19
|
|
2
|
4
|
|
|
4
|
|
34
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
97
|
|
3
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
299
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Story::Interact::Harness::Test; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.001014'; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
42
|
use Moo; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
26
|
|
11
|
4
|
|
|
4
|
|
1333
|
use Types::Common -types; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
52
|
|
12
|
4
|
|
|
4
|
|
55852
|
use namespace::clean; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
30
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Story::Interact::Harness'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has page => ( |
17
|
|
|
|
|
|
|
is => 'rwp', |
18
|
|
|
|
|
|
|
isa => Object, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub BUILD { |
22
|
9
|
|
|
9
|
0
|
738
|
my ( $self, $args ) = @_; |
23
|
9
|
|
|
|
|
41
|
my $page = $self->get_page( 'main' ); # hard code for testing |
24
|
9
|
|
|
|
|
184
|
$self->_set_page( $page ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub page_text { |
28
|
17
|
|
|
17
|
0
|
75
|
my ( $self ) = @_; |
29
|
17
|
|
|
|
|
31
|
join qq{\n\n}, @{ $self->page->text }; |
|
17
|
|
|
|
|
246
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub page_location { |
33
|
0
|
|
|
0
|
0
|
0
|
my ( $self ) = @_; |
34
|
0
|
|
|
|
|
0
|
$self->page->location; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub has_next_page { |
38
|
36
|
|
|
36
|
0
|
66
|
my ( $self, $regexp ) = @_; |
39
|
36
|
|
|
|
|
57
|
for my $next_page ( @{ $self->page->next_pages } ) { |
|
36
|
|
|
|
|
143
|
|
40
|
43
|
100
|
|
|
|
376
|
return $next_page if $next_page->[1] =~ $regexp; |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
0
|
return 0; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub go { |
46
|
36
|
|
|
36
|
0
|
1946
|
my ( $self, $regexp ) = @_; |
47
|
36
|
50
|
|
|
|
93
|
my $next_page = $self->has_next_page( $regexp ) or return 0; |
48
|
36
|
|
|
|
|
154
|
my $page = $self->get_page( $next_page->[0] ); |
49
|
36
|
|
|
|
|
654
|
$self->_set_page( $page ); |
50
|
36
|
|
|
|
|
1103
|
return 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |