line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
2150
|
use 5.010001; |
|
4
|
|
|
|
|
18
|
|
2
|
4
|
|
|
4
|
|
34
|
use strict; |
|
4
|
|
|
|
|
14
|
|
|
4
|
|
|
|
|
96
|
|
3
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
321
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Story::Interact::Harness::Test; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.001012'; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
31
|
use Moo; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
28
|
|
11
|
4
|
|
|
4
|
|
1386
|
use Types::Common -types; |
|
4
|
|
|
|
|
20
|
|
|
4
|
|
|
|
|
48
|
|
12
|
4
|
|
|
4
|
|
56221
|
use namespace::clean; |
|
4
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
35
|
|
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
|
1004
|
my ( $self, $args ) = @_; |
23
|
9
|
|
|
|
|
48
|
my $page = $self->get_page( 'main' ); # hard code for testing |
24
|
9
|
|
|
|
|
191
|
$self->_set_page( $page ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub page_text { |
28
|
17
|
|
|
17
|
0
|
93
|
my ( $self ) = @_; |
29
|
17
|
|
|
|
|
33
|
join qq{\n\n}, @{ $self->page->text }; |
|
17
|
|
|
|
|
287
|
|
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
|
75
|
my ( $self, $regexp ) = @_; |
39
|
36
|
|
|
|
|
52
|
for my $next_page ( @{ $self->page->next_pages } ) { |
|
36
|
|
|
|
|
156
|
|
40
|
43
|
100
|
|
|
|
355
|
return $next_page if $next_page->[1] =~ $regexp; |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
0
|
return 0; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub go { |
46
|
36
|
|
|
36
|
0
|
1940
|
my ( $self, $regexp ) = @_; |
47
|
36
|
50
|
|
|
|
113
|
my $next_page = $self->has_next_page( $regexp ) or return 0; |
48
|
36
|
|
|
|
|
150
|
my $page = $self->get_page( $next_page->[0] ); |
49
|
36
|
|
|
|
|
678
|
$self->_set_page( $page ); |
50
|
36
|
|
|
|
|
1106
|
return 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |