line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Venus::Test; |
2
|
|
|
|
|
|
|
|
3
|
132
|
|
|
132
|
|
5995555
|
use 5.018; |
|
130
|
|
|
|
|
1387
|
|
4
|
|
|
|
|
|
|
|
5
|
130
|
|
|
130
|
|
2445
|
use strict; |
|
130
|
|
|
|
|
504
|
|
|
129
|
|
|
|
|
2236
|
|
6
|
129
|
|
|
130
|
|
1175
|
use warnings; |
|
129
|
|
|
|
|
488
|
|
|
129
|
|
|
|
|
3281
|
|
7
|
|
|
|
|
|
|
|
8
|
129
|
|
|
130
|
|
39945
|
use Venus::Class 'attr', 'base', 'with'; |
|
129
|
|
|
|
|
519
|
|
|
129
|
|
|
|
|
640
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
base 'Venus::Kind'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Venus::Role::Buildable'; |
13
|
|
|
|
|
|
|
with 'Venus::Role::Throwable'; |
14
|
|
|
|
|
|
|
with 'Venus::Role::Tryable'; |
15
|
|
|
|
|
|
|
with 'Venus::Role::Catchable'; |
16
|
|
|
|
|
|
|
|
17
|
129
|
|
|
129
|
|
1860
|
use Test::More (); |
|
129
|
|
|
|
|
538
|
|
|
129
|
|
|
|
|
2069
|
|
18
|
|
|
|
|
|
|
|
19
|
129
|
|
|
129
|
|
2143
|
use Exporter 'import'; |
|
129
|
|
|
|
|
505
|
|
|
129
|
|
|
|
|
1219567
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @EXPORT = 'test'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# EXPORTS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub test { |
26
|
125
|
|
|
125
|
1
|
9445
|
Venus::Test->new($_[0]); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# ATTRIBUTES |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
attr 'file'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# BUILDERS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub build_arg { |
36
|
299
|
|
|
299
|
0
|
1227
|
my ($self, $data) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return { |
39
|
299
|
|
|
|
|
1372
|
file => $data, |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub build_self { |
44
|
299
|
|
|
299
|
0
|
1800
|
my ($self, $data) = @_; |
45
|
|
|
|
|
|
|
|
46
|
299
|
|
|
|
|
1028
|
for my $item (qw(name abstract tagline synopsis description)) { |
47
|
1395
|
50
|
|
|
|
3291
|
$self->error("on.build_self.$item") if !@{$self->find(undef, $item)}; |
|
1395
|
|
|
|
|
6322
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
299
|
|
|
|
|
2225
|
return $self; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub desc { |
56
|
197
|
|
|
197
|
0
|
736
|
my ($self, @args) = @_; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return join ' ', |
59
|
197
|
|
|
|
|
1406
|
map {s/^\s+|\s+$//gr} map {Test::More->can('explain')->($_)} @args; |
|
283
|
|
|
|
|
679838
|
|
|
283
|
|
|
|
|
3789
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub done { |
63
|
26
|
|
|
24
|
0
|
699
|
my ($self) = @_; |
64
|
|
|
|
|
|
|
|
65
|
24
|
|
|
|
|
255
|
return Test::More->can('done_testing')->(); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub dump { |
69
|
23
|
|
|
23
|
0
|
77
|
my ($self, @args) = @_; |
70
|
|
|
|
|
|
|
|
71
|
23
|
|
|
|
|
928
|
return Test::More->can('diag')->(Test::More->can('explain')->(@args)); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub encoding { |
75
|
23
|
|
|
23
|
0
|
178
|
my ($self, $name) = @_; |
76
|
|
|
|
|
|
|
|
77
|
23
|
|
|
|
|
69
|
return join("\n", "", "=encoding \U$name", "", "=cut"); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub error { |
81
|
38
|
|
|
38
|
0
|
696
|
my ($self, $name, $text, @args) = @_; |
82
|
|
|
|
|
|
|
|
83
|
38
|
|
|
|
|
220
|
my $throw; |
84
|
|
|
|
|
|
|
|
85
|
38
|
|
|
|
|
130
|
$throw = $self->throw; |
86
|
38
|
|
|
|
|
844
|
$throw->name($name); |
87
|
38
|
50
|
|
|
|
201
|
$throw->message($text) if $text; |
88
|
38
|
50
|
|
|
|
114
|
$throw->stash(@args) if @args; |
89
|
38
|
|
|
|
|
804
|
$throw->error; |
90
|
|
|
|
|
|
|
|
91
|
23
|
|
|
|
|
180
|
return; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub eval { |
95
|
2777
|
|
|
2777
|
0
|
7170
|
my ($self, $perl) = @_; |
96
|
|
|
|
|
|
|
|
97
|
2777
|
|
|
|
|
5462
|
local $@; |
98
|
|
|
|
|
|
|
|
99
|
128
|
100
|
66
|
128
|
|
1692
|
my @result = CORE::eval(join("\n\n", "no warnings q(redefine);", $perl)); |
|
128
|
100
|
33
|
128
|
|
599
|
|
|
128
|
50
|
0
|
122
|
|
5625
|
|
|
128
|
50
|
33
|
117
|
|
2350
|
|
|
128
|
50
|
|
110
|
|
507
|
|
|
128
|
100
|
|
106
|
|
2016
|
|
|
125
|
|
|
99
|
|
3365
|
|
|
122
|
|
|
97
|
|
4100
|
|
|
122
|
|
|
93
|
|
4852
|
|
|
117
|
|
|
93
|
|
2057
|
|
|
117
|
|
|
87
|
|
459
|
|
|
117
|
|
|
87
|
|
2515
|
|
|
111
|
|
|
87
|
|
2311
|
|
|
110
|
|
|
86
|
|
474
|
|
|
110
|
|
|
83
|
|
3944
|
|
|
106
|
|
|
83
|
|
1816
|
|
|
106
|
|
|
79
|
|
428
|
|
|
106
|
|
|
79
|
|
1743
|
|
|
101
|
|
|
77
|
|
1289
|
|
|
99
|
|
|
75
|
|
531
|
|
|
99
|
|
|
75
|
|
3096
|
|
|
97
|
|
|
75
|
|
1878
|
|
|
97
|
|
|
72
|
|
456
|
|
|
97
|
|
|
71
|
|
1902
|
|
|
95
|
|
|
71
|
|
1180
|
|
|
93
|
|
|
71
|
|
420
|
|
|
93
|
|
|
71
|
|
2870
|
|
|
93
|
|
|
70
|
|
1737
|
|
|
93
|
|
|
68
|
|
363
|
|
|
93
|
|
|
68
|
|
1359
|
|
|
89
|
|
|
579
|
|
1204
|
|
|
87
|
|
|
24
|
|
412
|
|
|
87
|
|
|
34
|
|
2811
|
|
|
87
|
|
|
36
|
|
1420
|
|
|
87
|
|
|
30
|
|
402
|
|
|
87
|
|
|
29
|
|
1176
|
|
|
87
|
|
|
43
|
|
1540
|
|
|
87
|
|
|
38
|
|
405
|
|
|
87
|
|
|
26
|
|
2890
|
|
|
87
|
|
|
11
|
|
2187
|
|
|
86
|
|
|
14
|
|
359
|
|
|
86
|
|
|
12
|
|
1301
|
|
|
84
|
|
|
12
|
|
1226
|
|
|
83
|
|
|
13
|
|
379
|
|
|
83
|
|
|
10
|
|
2471
|
|
|
83
|
|
|
13
|
|
1486
|
|
|
83
|
|
|
13
|
|
583
|
|
|
83
|
|
|
10
|
|
1071
|
|
|
80
|
|
|
10
|
|
2822
|
|
|
79
|
|
|
10
|
|
378
|
|
|
79
|
|
|
10
|
|
2339
|
|
|
79
|
|
|
10
|
|
1401
|
|
|
79
|
|
|
9
|
|
312
|
|
|
79
|
|
|
9
|
|
1007
|
|
|
78
|
|
|
9
|
|
1137
|
|
|
77
|
|
|
9
|
|
375
|
|
|
77
|
|
|
7
|
|
2204
|
|
|
77
|
|
|
7
|
|
1181
|
|
|
75
|
|
|
7
|
|
295
|
|
|
75
|
|
|
7
|
|
950
|
|
|
75
|
|
|
7
|
|
1519
|
|
|
75
|
|
|
7
|
|
337
|
|
|
75
|
|
|
7
|
|
2377
|
|
|
75
|
|
|
7
|
|
1759
|
|
|
75
|
|
|
7
|
|
336
|
|
|
75
|
|
|
7
|
|
1082
|
|
|
73
|
|
|
7
|
|
996
|
|
|
72
|
|
|
7
|
|
325
|
|
|
72
|
|
|
7
|
|
2129
|
|
|
71
|
|
|
7
|
|
1183
|
|
|
71
|
|
|
6
|
|
731
|
|
|
71
|
|
|
6
|
|
855
|
|
|
71
|
|
|
5
|
|
1710
|
|
|
71
|
|
|
5
|
|
327
|
|
|
71
|
|
|
5
|
|
1962
|
|
|
71
|
|
|
5
|
|
1708
|
|
|
71
|
|
|
5
|
|
322
|
|
|
71
|
|
|
5
|
|
1096
|
|
|
71
|
|
|
5
|
|
943
|
|
|
71
|
|
|
5
|
|
858
|
|
|
71
|
|
|
5
|
|
1988
|
|
|
70
|
|
|
5
|
|
1151
|
|
|
70
|
|
|
5
|
|
301
|
|
|
70
|
|
|
5
|
|
1136
|
|
|
68
|
|
|
5
|
|
944
|
|
|
68
|
|
|
5
|
|
329
|
|
|
68
|
|
|
5
|
|
1824
|
|
|
68
|
|
|
5
|
|
1173
|
|
|
68
|
|
|
5
|
|
307
|
|
|
68
|
|
|
5
|
|
688
|
|
|
2777
|
|
|
5
|
|
342625
|
|
|
570
|
|
|
5
|
|
2518
|
|
|
358
|
|
|
5
|
|
1391
|
|
|
23
|
|
|
5
|
|
112
|
|
|
10
|
|
|
5
|
|
54
|
|
|
29
|
|
|
5
|
|
159
|
|
|
27
|
|
|
5
|
|
114
|
|
|
12
|
|
|
5
|
|
72
|
|
|
28
|
|
|
5
|
|
213
|
|
|
26
|
|
|
5
|
|
135
|
|
|
10
|
|
|
5
|
|
55
|
|
|
12
|
|
|
5
|
|
69
|
|
|
40
|
|
|
5
|
|
191
|
|
|
20
|
|
|
5
|
|
62
|
|
|
20
|
|
|
5
|
|
216
|
|
|
40
|
|
|
5
|
|
236
|
|
|
7
|
|
|
5
|
|
17
|
|
|
6
|
|
|
5
|
|
42
|
|
|
7
|
|
|
5
|
|
75
|
|
|
16
|
|
|
5
|
|
122
|
|
|
6
|
|
|
5
|
|
147
|
|
|
3
|
|
|
5
|
|
31
|
|
|
6
|
|
|
4
|
|
25
|
|
|
6
|
|
|
4
|
|
54
|
|
|
4
|
|
|
4
|
|
22
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
52
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
47
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
4
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
55
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
9
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
61
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
64
|
|
|
1
|
|
|
4
|
|
9
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
9
|
|
|
1
|
|
|
3
|
|
7
|
|
|
1
|
|
|
3
|
|
2
|
|
|
1
|
|
|
3
|
|
43
|
|
|
1
|
|
|
3
|
|
6
|
|
|
1
|
|
|
3
|
|
2
|
|
|
1
|
|
|
3
|
|
6
|
|
|
1
|
|
|
3
|
|
7
|
|
|
1
|
|
|
3
|
|
3
|
|
|
1
|
|
|
3
|
|
43
|
|
|
1
|
|
|
3
|
|
6
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
2
|
|
8
|
|
|
1
|
|
|
2
|
|
4
|
|
|
1
|
|
|
2
|
|
52
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
4
|
|
|
1
|
|
|
2
|
|
8
|
|
|
1
|
|
|
2
|
|
8
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
74
|
|
|
1
|
|
|
2
|
|
10
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
9
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
68
|
|
|
1
|
|
|
2
|
|
5
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
8
|
|
|
1
|
|
|
2
|
|
12
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
2
|
|
72
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
65
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
62
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
42
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
41
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
46
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
10
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
42
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
50
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
71
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
64
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
74
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
16
|
|
100
|
|
|
|
|
|
|
|
101
|
2777
|
|
|
|
|
8352
|
my $dollarat = $@; |
102
|
|
|
|
|
|
|
|
103
|
2777
|
100
|
|
|
|
8344
|
die $dollarat if $dollarat; |
104
|
|
|
|
|
|
|
|
105
|
2702
|
50
|
|
|
|
16255
|
return wantarray ? (@result) : $result[0]; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub fail { |
109
|
24
|
|
|
24
|
0
|
79
|
my ($self, $data, $desc) = @_; |
110
|
|
|
|
|
|
|
|
111
|
24
|
|
33
|
|
|
844
|
return $self->proxy('ok', !!!$data, $desc) || $self->dump($data); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub find { |
115
|
3414
|
|
|
3414
|
0
|
12697
|
my ($self, @args) = @_; |
116
|
|
|
|
|
|
|
|
117
|
3414
|
|
|
|
|
9727
|
return $self->spec->find(@args); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub for { |
121
|
3521
|
|
|
3521
|
1
|
54185
|
my ($self, $name, @args) = @_; |
122
|
|
|
|
|
|
|
|
123
|
3520
|
|
|
|
|
6381
|
my $result; |
124
|
|
|
|
|
|
|
|
125
|
3520
|
|
|
|
|
8627
|
my $method = "test_for_$name"; |
126
|
|
|
|
|
|
|
|
127
|
3520
|
50
|
|
|
|
20777
|
$self->error("on.for.$name") if !$self->can($method); |
128
|
|
|
|
|
|
|
|
129
|
11811
|
100
|
|
|
|
45056
|
$self->proxy('subtest', join(' ', map {ref($_) ? () : $_} $method, @args), sub { |
130
|
3520
|
|
|
3520
|
|
2872624
|
$result = $self->$method(@args); |
131
|
3520
|
|
|
|
|
10163
|
}); |
132
|
|
|
|
|
|
|
|
133
|
3520
|
|
|
|
|
4723572
|
return $result; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub head1 { |
137
|
206
|
|
|
206
|
0
|
1055
|
my ($self, $name, @data) = @_; |
138
|
|
|
|
|
|
|
|
139
|
206
|
|
|
|
|
4156
|
return join("\n", "", "=head1 \U$name", "", grep(defined, @data), "", "=cut"); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub head2 { |
143
|
28
|
|
|
28
|
0
|
173
|
my ($self, $name, @data) = @_; |
144
|
|
|
|
|
|
|
|
145
|
28
|
|
|
|
|
153
|
return join("\n", "", "=head2 \L$name", "", grep(defined, @data), "", "=cut"); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub item { |
149
|
37
|
|
|
37
|
1
|
444
|
my ($self, $name, $data) = @_; |
150
|
|
|
|
|
|
|
|
151
|
37
|
|
|
|
|
238
|
return ("=item $name\n", "$data\n"); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub like { |
155
|
43
|
|
|
43
|
0
|
13693
|
my ($self, $this, $that, $desc) = @_; |
156
|
|
|
|
|
|
|
|
157
|
43
|
50
|
|
|
|
1165
|
$that = qr/$that/ if ref $that ne 'Regexp'; |
158
|
|
|
|
|
|
|
|
159
|
42
|
|
|
|
|
207
|
return $self->proxy('like', $this, $that, $desc); |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub link { |
163
|
26
|
|
|
26
|
0
|
75
|
my ($self, @data) = @_; |
164
|
|
|
|
|
|
|
|
165
|
26
|
|
|
|
|
458
|
return ("L<@{[join('|', @data)]}>"); |
|
25
|
|
|
|
|
335
|
|
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub okay { |
169
|
22
|
|
|
22
|
0
|
86
|
my ($self, $data, $desc) = @_; |
170
|
|
|
|
|
|
|
|
171
|
22
|
|
|
|
|
1483
|
return $self->proxy('ok', !!$data, $desc); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub over { |
175
|
35
|
|
|
35
|
0
|
362
|
my ($self, @data) = @_; |
176
|
|
|
|
|
|
|
|
177
|
35
|
|
|
|
|
191
|
return join("\n", "", "=over 4", "", grep(defined, @data), "=back"); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub pass { |
181
|
7728
|
|
|
7728
|
0
|
22023
|
my ($self, $data, $desc) = @_; |
182
|
|
|
|
|
|
|
|
183
|
7728
|
|
33
|
|
|
24661
|
return $self->proxy('ok', !!$data, $desc) || $self->dump($data); |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub proxy { |
187
|
11253
|
|
|
11253
|
0
|
35363
|
my ($self, $name, @args) = @_; |
188
|
|
|
|
|
|
|
|
189
|
11253
|
|
|
|
|
19254
|
my $level = 1; |
190
|
11253
|
|
|
|
|
17068
|
my $regexp = qr{@{[quotemeta($self->file)]}$}; |
|
11253
|
|
|
|
|
33950
|
|
191
|
|
|
|
|
|
|
|
192
|
11253
|
|
|
|
|
101606
|
for (my $i = 0; my @caller = caller($i); $i++) { |
193
|
77630
|
100
|
|
|
|
114386
|
$level += $i; last if $caller[1] =~ $regexp; |
|
77630
|
|
|
|
|
511870
|
|
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
11253
|
|
|
|
|
29363
|
local $Test::Builder::Level = $Test::Builder::Level + $level; |
197
|
|
|
|
|
|
|
|
198
|
11253
|
|
|
|
|
65203
|
return Test::More->can($name)->(@args); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub render { |
202
|
21
|
|
|
21
|
1
|
57
|
my ($self, $file) = @_; |
203
|
|
|
|
|
|
|
|
204
|
21
|
|
|
|
|
361
|
require Venus::Path; |
205
|
|
|
|
|
|
|
|
206
|
21
|
|
|
|
|
171
|
my $path = Venus::Path->new($file); |
207
|
|
|
|
|
|
|
|
208
|
21
|
|
|
|
|
62
|
$path->parent->mkdirs; |
209
|
|
|
|
|
|
|
|
210
|
21
|
|
|
|
|
659
|
my @layout = ( |
211
|
|
|
|
|
|
|
'encoding', |
212
|
|
|
|
|
|
|
'name', |
213
|
|
|
|
|
|
|
'abstract', |
214
|
|
|
|
|
|
|
'version', |
215
|
|
|
|
|
|
|
'synopsis', |
216
|
|
|
|
|
|
|
'description', |
217
|
|
|
|
|
|
|
'attributes: attribute', |
218
|
|
|
|
|
|
|
'inherits', |
219
|
|
|
|
|
|
|
'integrates', |
220
|
|
|
|
|
|
|
'libraries', |
221
|
|
|
|
|
|
|
'functions: function', |
222
|
|
|
|
|
|
|
'methods: method', |
223
|
|
|
|
|
|
|
'messages: message', |
224
|
|
|
|
|
|
|
'features: feature', |
225
|
|
|
|
|
|
|
'errors: error', |
226
|
|
|
|
|
|
|
'operators: operator', |
227
|
|
|
|
|
|
|
'partials', |
228
|
|
|
|
|
|
|
'authors', |
229
|
|
|
|
|
|
|
'license', |
230
|
|
|
|
|
|
|
'project', |
231
|
|
|
|
|
|
|
); |
232
|
|
|
|
|
|
|
|
233
|
21
|
50
|
|
|
|
159
|
if (@{$self->find(undef, 'layout')}) { |
|
21
|
|
|
|
|
50
|
|
234
|
20
|
|
|
|
|
506
|
@layout = (split /\r?\n/, $self->text('layout')); |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
21
|
|
|
|
|
180
|
$path->write(join "\n", grep !!$_, map $self->show($_), @layout); |
238
|
|
|
|
|
|
|
|
239
|
21
|
|
|
|
|
64
|
return $path; |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub same { |
243
|
23
|
|
|
23
|
0
|
572
|
my ($self, $this, $that, $desc) = @_; |
244
|
|
|
|
|
|
|
|
245
|
23
|
|
|
|
|
175
|
return $self->proxy('is_deeply', $this, $that, $desc); |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
sub search { |
249
|
3803
|
|
|
3803
|
0
|
9266
|
my ($self, @args) = @_; |
250
|
|
|
|
|
|
|
|
251
|
3803
|
|
|
|
|
10657
|
return $self->spec->search(@args); |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub show { |
255
|
40
|
|
|
40
|
0
|
200
|
my ($self, $spec) = @_; |
256
|
|
|
|
|
|
|
|
257
|
40
|
|
|
|
|
149
|
my ($name, $list) = split /:\s*/, $spec; |
258
|
|
|
|
|
|
|
|
259
|
40
|
|
|
|
|
661
|
my $method = "pdml_for_$name"; |
260
|
|
|
|
|
|
|
|
261
|
40
|
50
|
|
|
|
278
|
if ($self->can($method)) { |
262
|
40
|
|
|
|
|
96
|
return $self->pdml($name); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
20
|
0
|
|
|
|
475
|
my $results = $self->search({$list ? (list => $list) : (name => $name)}); |
266
|
|
|
|
|
|
|
|
267
|
20
|
0
|
0
|
|
|
144
|
$self->error("on.show.$name") if !@$results && !grep $name eq $_, qw( |
268
|
|
|
|
|
|
|
messages |
269
|
|
|
|
|
|
|
); |
270
|
|
|
|
|
|
|
|
271
|
20
|
|
|
|
|
67
|
my @output; |
272
|
20
|
|
|
|
|
737
|
my $textual = 1; |
273
|
|
|
|
|
|
|
|
274
|
20
|
|
|
|
|
154
|
for my $result (@$results) { |
275
|
20
|
|
|
|
|
64
|
my @block; |
276
|
|
|
|
|
|
|
|
277
|
20
|
|
|
|
|
426
|
my $examples = 0; |
278
|
20
|
|
|
|
|
159
|
my $metadata = $self->text('metadata', $result->{name}); |
279
|
20
|
|
|
|
|
53
|
my $signature = $self->text('signature', $result->{name}); |
280
|
|
|
|
|
|
|
|
281
|
20
|
0
|
|
|
|
639
|
push @block, ($signature, '') if $signature; |
282
|
|
|
|
|
|
|
|
283
|
19
|
|
|
|
|
144
|
my $text = join "\n\n", @{$result->{data}}; |
|
19
|
|
|
|
|
56
|
|
284
|
|
|
|
|
|
|
|
285
|
19
|
0
|
|
|
|
485
|
if (!$text) { |
286
|
19
|
|
|
|
|
149
|
next; |
287
|
|
|
|
|
|
|
} |
288
|
|
|
|
|
|
|
else { |
289
|
19
|
|
|
|
|
64
|
push @block, $text; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
19
|
0
|
|
|
|
568
|
if ($metadata) { |
293
|
19
|
|
|
|
|
140
|
local $@; |
294
|
19
|
0
|
|
|
|
51
|
if ($metadata = eval $metadata) { |
295
|
19
|
0
|
|
|
|
309
|
if (my $since = $metadata->{since}) { |
296
|
19
|
|
|
|
|
138
|
push @block, "", "I>"; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
19
|
|
|
|
|
65
|
my @results = $self->search({name => $result->{name}}); |
302
|
|
|
|
|
|
|
|
303
|
19
|
|
0
|
|
|
731
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
19
|
|
|
|
|
131
|
|
304
|
19
|
|
|
|
|
55
|
push @block, $self->pdml('example', $i, $result->{name}); |
305
|
19
|
|
|
|
|
370
|
$examples++; |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
19
|
0
|
0
|
|
|
149
|
if ($signature || $metadata || $examples) { |
|
|
|
0
|
|
|
|
|
309
|
19
|
|
|
|
|
68
|
push @output, ($self->head2($result->{name}, @block)); |
310
|
19
|
|
|
|
|
575
|
$textual = 0; |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
else { |
313
|
19
|
|
|
|
|
137
|
push @output, @block; |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
19
|
0
|
|
|
|
64
|
if (@output) { |
318
|
19
|
0
|
|
|
|
593
|
if ($textual) { |
319
|
19
|
|
|
|
|
158
|
@output = $self->head1($name, join "\n\n", @output); |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
else { |
322
|
19
|
0
|
0
|
|
|
54
|
unshift @output, $self->head1($name, |
323
|
|
|
|
|
|
|
($self->count({list => 'heading'}) |
324
|
|
|
|
|
|
|
? ($self->text('heading', $name) || $self->text('heading', $list)) |
325
|
|
|
|
|
|
|
: "This package provides the following $name:"), |
326
|
|
|
|
|
|
|
); |
327
|
|
|
|
|
|
|
} |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
19
|
|
|
|
|
580
|
return join "\n", @output; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
sub spec { |
334
|
7193
|
|
|
7194
|
0
|
14383
|
my ($self) = @_; |
335
|
|
|
|
|
|
|
|
336
|
7193
|
|
|
|
|
92297
|
require Venus::Data; |
337
|
|
|
|
|
|
|
|
338
|
7193
|
|
66
|
|
|
38787
|
$self->{data} ||= Venus::Data->new($self->file); |
339
|
|
|
|
|
|
|
|
340
|
7193
|
|
|
|
|
30630
|
return $self->{data}; |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub data { |
344
|
4877
|
|
|
4878
|
1
|
13191
|
my ($self, $name, @args) = @_; |
345
|
|
|
|
|
|
|
|
346
|
4877
|
|
|
|
|
12056
|
my $method = "data_for_$name"; |
347
|
|
|
|
|
|
|
|
348
|
4877
|
100
|
|
|
|
24043
|
$self->error("on.data.$name") if !$self->can($method); |
349
|
|
|
|
|
|
|
|
350
|
4876
|
100
|
|
|
|
20893
|
wantarray ? ($self->$method(@args)) : $self->$method(@args); |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
sub data_for_abstract { |
354
|
106
|
|
|
107
|
0
|
655
|
my ($self) = @_; |
355
|
|
|
|
|
|
|
|
356
|
105
|
|
|
|
|
467
|
my $data = $self->find(undef, 'abstract'); |
357
|
|
|
|
|
|
|
|
358
|
105
|
50
|
|
|
|
574
|
$self->error('on.data.for.abstract') if !@$data; |
359
|
|
|
|
|
|
|
|
360
|
105
|
|
|
|
|
743
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
767
|
|
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
sub data_for_attribute { |
364
|
18
|
|
|
20
|
0
|
40
|
my ($self, $name) = @_; |
365
|
|
|
|
|
|
|
|
366
|
18
|
|
|
|
|
415
|
my $data = $self->search({ |
367
|
|
|
|
|
|
|
list => 'attribute', |
368
|
|
|
|
|
|
|
name => $name, |
369
|
|
|
|
|
|
|
}); |
370
|
|
|
|
|
|
|
|
371
|
18
|
0
|
|
|
|
114
|
$self->error('on.data.for.attribute') if !@$data; |
372
|
|
|
|
|
|
|
|
373
|
18
|
|
|
|
|
53
|
return join "\n\n", @{$data->[0]{data}}; |
|
18
|
|
|
|
|
465
|
|
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub data_for_attributes { |
377
|
35
|
|
|
37
|
0
|
198
|
my ($self) = @_; |
378
|
|
|
|
|
|
|
|
379
|
35
|
|
|
|
|
122
|
my $data = $self->find(undef, 'attributes'); |
380
|
|
|
|
|
|
|
|
381
|
35
|
100
|
|
|
|
454
|
$self->error('on.data.for.attributes') if !@$data; |
382
|
|
|
|
|
|
|
|
383
|
33
|
|
|
|
|
191
|
return join "\n\n", @{$data->[0]{data}}; |
|
33
|
|
|
|
|
184
|
|
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
sub data_for_authors { |
387
|
106
|
|
|
108
|
0
|
1365
|
my ($self) = @_; |
388
|
|
|
|
|
|
|
|
389
|
106
|
|
|
|
|
954
|
my $data = $self->find(undef, 'authors'); |
390
|
|
|
|
|
|
|
|
391
|
106
|
100
|
|
|
|
777
|
$self->error('on.data.for.authors') if !@$data; |
392
|
|
|
|
|
|
|
|
393
|
105
|
|
|
|
|
557
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
1365
|
|
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
sub data_for_description { |
397
|
105
|
|
|
107
|
0
|
408
|
my ($self) = @_; |
398
|
|
|
|
|
|
|
|
399
|
105
|
|
|
|
|
972
|
my $data = $self->find(undef, 'description'); |
400
|
|
|
|
|
|
|
|
401
|
105
|
50
|
|
|
|
787
|
$self->error('on.data.for.description') if !@$data; |
402
|
|
|
|
|
|
|
|
403
|
105
|
|
|
|
|
324
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
1026
|
|
404
|
|
|
|
|
|
|
} |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
sub data_for_encoding { |
407
|
19
|
|
|
20
|
0
|
151
|
my ($self) = @_; |
408
|
|
|
|
|
|
|
|
409
|
19
|
|
|
|
|
51
|
my $data = $self->find(undef, 'encoding'); |
410
|
|
|
|
|
|
|
|
411
|
19
|
50
|
|
|
|
436
|
$self->error('on.data.for.encoding') if !@$data; |
412
|
|
|
|
|
|
|
|
413
|
18
|
|
|
|
|
120
|
return (map {map uc, split /\r?\n+/} @{$data->[0]{data}})[0]; |
|
18
|
|
|
|
|
67
|
|
|
18
|
|
|
|
|
411
|
|
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub data_for_error { |
417
|
47
|
|
|
49
|
0
|
249
|
my ($self, $name) = @_; |
418
|
|
|
|
|
|
|
|
419
|
47
|
|
|
|
|
255
|
my $data = $self->search({ |
420
|
|
|
|
|
|
|
list => 'error', |
421
|
|
|
|
|
|
|
name => $name, |
422
|
|
|
|
|
|
|
}); |
423
|
|
|
|
|
|
|
|
424
|
47
|
50
|
|
|
|
750
|
$self->error('on.data.for.error') if !@$data; |
425
|
|
|
|
|
|
|
|
426
|
47
|
|
|
|
|
211
|
return join "\n\n", @{$data->[0]{data}}; |
|
47
|
|
|
|
|
319
|
|
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub data_for_example { |
430
|
2715
|
|
|
2717
|
0
|
7068
|
my ($self, $number, $name) = @_; |
431
|
|
|
|
|
|
|
|
432
|
2715
|
|
|
|
|
13686
|
my $data = $self->search({ |
433
|
|
|
|
|
|
|
list => "example-$number", |
434
|
|
|
|
|
|
|
name => $name, |
435
|
|
|
|
|
|
|
}); |
436
|
|
|
|
|
|
|
|
437
|
2715
|
50
|
|
|
|
13416
|
$self->error('on.data.for.example') if !@$data; |
438
|
|
|
|
|
|
|
|
439
|
2715
|
|
|
|
|
6107
|
return join "\n\n", @{$data->[0]{data}}; |
|
2715
|
|
|
|
|
22253
|
|
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub data_for_feature { |
443
|
32
|
|
|
34
|
0
|
105
|
my ($self, $name) = @_; |
444
|
|
|
|
|
|
|
|
445
|
32
|
|
|
|
|
409
|
my $data = $self->search({ |
446
|
|
|
|
|
|
|
list => 'feature', |
447
|
|
|
|
|
|
|
name => $name, |
448
|
|
|
|
|
|
|
}); |
449
|
|
|
|
|
|
|
|
450
|
31
|
50
|
|
|
|
233
|
$self->error('on.data.for.feature') if !@$data; |
451
|
|
|
|
|
|
|
|
452
|
31
|
|
|
|
|
82
|
return join "\n\n", @{$data->[0]{data}}; |
|
31
|
|
|
|
|
567
|
|
453
|
|
|
|
|
|
|
} |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
sub data_for_function { |
456
|
17
|
|
|
20
|
0
|
130
|
my ($self, $name) = @_; |
457
|
|
|
|
|
|
|
|
458
|
17
|
|
|
|
|
59
|
my $data = $self->search({ |
459
|
|
|
|
|
|
|
list => 'function', |
460
|
|
|
|
|
|
|
name => $name, |
461
|
|
|
|
|
|
|
}); |
462
|
|
|
|
|
|
|
|
463
|
17
|
50
|
|
|
|
423
|
$self->error('on.data.for.function') if !@$data; |
464
|
|
|
|
|
|
|
|
465
|
17
|
|
|
|
|
114
|
return join "\n\n", @{$data->[0]{data}}; |
|
17
|
|
|
|
|
50
|
|
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub data_for_heading { |
469
|
20
|
|
|
23
|
0
|
462
|
my ($self, $name) = @_; |
470
|
|
|
|
|
|
|
|
471
|
20
|
|
|
|
|
136
|
my $data = $self->search({ |
472
|
|
|
|
|
|
|
list => 'heading', |
473
|
|
|
|
|
|
|
name => $name, |
474
|
|
|
|
|
|
|
}); |
475
|
|
|
|
|
|
|
|
476
|
20
|
50
|
|
|
|
65
|
$self->error('on.data.for.heading') if !@$data; |
477
|
|
|
|
|
|
|
|
478
|
16
|
|
|
|
|
348
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
137
|
|
479
|
|
|
|
|
|
|
} |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
sub data_for_includes { |
482
|
99
|
|
|
103
|
0
|
340
|
my ($self) = @_; |
483
|
|
|
|
|
|
|
|
484
|
99
|
|
|
|
|
879
|
my $data = $self->find(undef, 'includes'); |
485
|
|
|
|
|
|
|
|
486
|
99
|
50
|
|
|
|
656
|
$self->error('on.data.for.includes') if !@$data; |
487
|
|
|
|
|
|
|
|
488
|
99
|
|
|
|
|
318
|
return join "\n\n", @{$data->[0]{data}}; |
|
99
|
|
|
|
|
946
|
|
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
sub data_for_inherits { |
492
|
64
|
|
|
68
|
0
|
326
|
my ($self) = @_; |
493
|
|
|
|
|
|
|
|
494
|
64
|
|
|
|
|
226
|
my $data = $self->find(undef, 'inherits'); |
495
|
|
|
|
|
|
|
|
496
|
64
|
50
|
|
|
|
693
|
$self->error('on.data.for.inherits') if !@$data; |
497
|
|
|
|
|
|
|
|
498
|
64
|
|
|
|
|
266
|
return join "\n\n", @{$data->[0]{data}}; |
|
64
|
|
|
|
|
395
|
|
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
sub data_for_integrates { |
502
|
43
|
|
|
47
|
0
|
515
|
my ($self) = @_; |
503
|
|
|
|
|
|
|
|
504
|
43
|
|
|
|
|
220
|
my $data = $self->find(undef, 'integrates'); |
505
|
|
|
|
|
|
|
|
506
|
43
|
50
|
|
|
|
238
|
$self->error('on.data.for.integrates') if !@$data; |
507
|
|
|
|
|
|
|
|
508
|
43
|
|
|
|
|
520
|
return join "\n\n", @{$data->[0]{data}}; |
|
43
|
|
|
|
|
351
|
|
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
sub data_for_layout { |
512
|
15
|
|
|
19
|
0
|
33
|
my ($self) = @_; |
513
|
|
|
|
|
|
|
|
514
|
15
|
|
|
|
|
248
|
my $data = $self->find(undef, 'layout'); |
515
|
|
|
|
|
|
|
|
516
|
15
|
0
|
|
|
|
113
|
$self->error('on.data.for.layout') if !@$data; |
517
|
|
|
|
|
|
|
|
518
|
15
|
|
|
|
|
52
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
544
|
|
519
|
|
|
|
|
|
|
} |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
sub data_for_libraries { |
522
|
17
|
|
|
21
|
0
|
113
|
my ($self) = @_; |
523
|
|
|
|
|
|
|
|
524
|
17
|
|
|
|
|
52
|
my $data = $self->find(undef, 'libraries'); |
525
|
|
|
|
|
|
|
|
526
|
17
|
50
|
|
|
|
244
|
$self->error('on.data.for.libraries') if !@$data; |
527
|
|
|
|
|
|
|
|
528
|
15
|
|
|
|
|
110
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
52
|
|
529
|
|
|
|
|
|
|
} |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
sub data_for_license { |
532
|
103
|
|
|
106
|
0
|
746
|
my ($self) = @_; |
533
|
|
|
|
|
|
|
|
534
|
103
|
|
|
|
|
547
|
my $data = $self->find(undef, 'license'); |
535
|
|
|
|
|
|
|
|
536
|
103
|
100
|
|
|
|
1125
|
$self->error('on.data.for.license') if !@$data; |
537
|
|
|
|
|
|
|
|
538
|
102
|
|
|
|
|
696
|
return join "\n\n", @{$data->[0]{data}}; |
|
102
|
|
|
|
|
1493
|
|
539
|
|
|
|
|
|
|
} |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
sub data_for_message { |
542
|
15
|
|
|
18
|
0
|
68
|
my ($self, $name) = @_; |
543
|
|
|
|
|
|
|
|
544
|
15
|
|
|
|
|
415
|
my $data = $self->search({ |
545
|
|
|
|
|
|
|
list => 'message', |
546
|
|
|
|
|
|
|
name => $name, |
547
|
|
|
|
|
|
|
}); |
548
|
|
|
|
|
|
|
|
549
|
15
|
0
|
|
|
|
111
|
$self->error('on.data.for.message') if !@$data; |
550
|
|
|
|
|
|
|
|
551
|
15
|
|
|
|
|
39
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
226
|
|
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
sub data_for_metadata { |
555
|
21
|
|
|
24
|
0
|
136
|
my ($self, $name) = @_; |
556
|
|
|
|
|
|
|
|
557
|
21
|
|
|
|
|
104
|
my $data = $self->search({ |
558
|
|
|
|
|
|
|
list => 'metadata', |
559
|
|
|
|
|
|
|
name => $name, |
560
|
|
|
|
|
|
|
}); |
561
|
|
|
|
|
|
|
|
562
|
21
|
50
|
|
|
|
524
|
$self->error('on.data.for.metadata') if !@$data; |
563
|
|
|
|
|
|
|
|
564
|
21
|
|
|
|
|
112
|
return join "\n\n", @{$data->[0]{data}}; |
|
21
|
|
|
|
|
99
|
|
565
|
|
|
|
|
|
|
} |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
sub data_for_method { |
568
|
20
|
|
|
23
|
0
|
235
|
my ($self, $name) = @_; |
569
|
|
|
|
|
|
|
|
570
|
20
|
|
|
|
|
124
|
my $data = $self->search({ |
571
|
|
|
|
|
|
|
list => 'method', |
572
|
|
|
|
|
|
|
name => $name, |
573
|
|
|
|
|
|
|
}); |
574
|
|
|
|
|
|
|
|
575
|
20
|
50
|
|
|
|
53
|
$self->error('on.data.for.method') if !@$data; |
576
|
|
|
|
|
|
|
|
577
|
20
|
|
|
|
|
319
|
return join "\n\n", @{$data->[0]{data}}; |
|
20
|
|
|
|
|
145
|
|
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
sub data_for_name { |
581
|
195
|
|
|
198
|
0
|
548
|
my ($self) = @_; |
582
|
|
|
|
|
|
|
|
583
|
195
|
|
|
|
|
994
|
my $data = $self->find(undef, 'name'); |
584
|
|
|
|
|
|
|
|
585
|
195
|
50
|
|
|
|
1062
|
$self->error('on.data.for.name') if !@$data; |
586
|
|
|
|
|
|
|
|
587
|
195
|
|
|
|
|
470
|
return join "\n\n", @{$data->[0]{data}}; |
|
195
|
|
|
|
|
1658
|
|
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
sub data_for_operator { |
591
|
87
|
|
|
90
|
0
|
314
|
my ($self, $name) = @_; |
592
|
|
|
|
|
|
|
|
593
|
87
|
|
|
|
|
380
|
my $data = $self->search({ |
594
|
|
|
|
|
|
|
list => 'operator', |
595
|
|
|
|
|
|
|
name => $name, |
596
|
|
|
|
|
|
|
}); |
597
|
|
|
|
|
|
|
|
598
|
87
|
50
|
|
|
|
712
|
$self->error('on.data.for.operator') if !@$data; |
599
|
|
|
|
|
|
|
|
600
|
87
|
|
|
|
|
274
|
return join "\n\n", @{$data->[0]{data}}; |
|
87
|
|
|
|
|
543
|
|
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
sub data_for_partials { |
604
|
102
|
|
|
105
|
0
|
708
|
my ($self) = @_; |
605
|
|
|
|
|
|
|
|
606
|
102
|
|
|
|
|
509
|
my $data = $self->find(undef, 'partials'); |
607
|
|
|
|
|
|
|
|
608
|
102
|
50
|
|
|
|
677
|
$self->error('on.data.for.partials') if !@$data; |
609
|
|
|
|
|
|
|
|
610
|
102
|
|
|
|
|
597
|
return join "\n\n", @{$data->[0]{data}}; |
|
102
|
|
|
|
|
764
|
|
611
|
|
|
|
|
|
|
} |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
sub data_for_project { |
614
|
16
|
|
|
19
|
0
|
41
|
my ($self) = @_; |
615
|
|
|
|
|
|
|
|
616
|
16
|
|
|
|
|
452
|
my $data = $self->find(undef, 'project'); |
617
|
|
|
|
|
|
|
|
618
|
16
|
50
|
|
|
|
122
|
$self->error('on.data.for.project') if !@$data; |
619
|
|
|
|
|
|
|
|
620
|
15
|
|
|
|
|
42
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
274
|
|
621
|
|
|
|
|
|
|
} |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
sub data_for_signature { |
624
|
21
|
|
|
24
|
0
|
120
|
my ($self, $name) = @_; |
625
|
|
|
|
|
|
|
|
626
|
21
|
|
|
|
|
73
|
my $data = $self->search({ |
627
|
|
|
|
|
|
|
list => 'signature', |
628
|
|
|
|
|
|
|
name => $name, |
629
|
|
|
|
|
|
|
}); |
630
|
|
|
|
|
|
|
|
631
|
21
|
50
|
|
|
|
469
|
$self->error('on.data.for.signature') if !@$data; |
632
|
|
|
|
|
|
|
|
633
|
21
|
|
|
|
|
141
|
return join "\n\n", @{$data->[0]{data}}; |
|
21
|
|
|
|
|
95
|
|
634
|
|
|
|
|
|
|
} |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
sub data_for_synopsis { |
637
|
1147
|
|
|
1150
|
0
|
3567
|
my ($self) = @_; |
638
|
|
|
|
|
|
|
|
639
|
1147
|
|
|
|
|
4383
|
my $data = $self->find(undef, 'synopsis'); |
640
|
|
|
|
|
|
|
|
641
|
1147
|
50
|
|
|
|
5962
|
$self->error('on.data.for.synopsis') if !@$data; |
642
|
|
|
|
|
|
|
|
643
|
1147
|
|
|
|
|
2963
|
return join "\n\n", @{$data->[0]{data}}; |
|
1147
|
|
|
|
|
10129
|
|
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
sub data_for_tagline { |
647
|
103
|
|
|
105
|
0
|
339
|
my ($self) = @_; |
648
|
|
|
|
|
|
|
|
649
|
103
|
|
|
|
|
552
|
my $data = $self->find(undef, 'tagline'); |
650
|
|
|
|
|
|
|
|
651
|
103
|
50
|
|
|
|
725
|
$self->error('on.data.for.tagline') if !@$data; |
652
|
|
|
|
|
|
|
|
653
|
103
|
|
|
|
|
344
|
return join "\n\n", @{$data->[0]{data}}; |
|
103
|
|
|
|
|
1263
|
|
654
|
|
|
|
|
|
|
} |
655
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
sub data_for_version { |
657
|
16
|
|
|
18
|
0
|
117
|
my ($self) = @_; |
658
|
|
|
|
|
|
|
|
659
|
16
|
|
|
|
|
42
|
my $data = $self->find(undef, 'version'); |
660
|
|
|
|
|
|
|
|
661
|
16
|
50
|
|
|
|
332
|
$self->error('on.data.for.version') if !@$data; |
662
|
|
|
|
|
|
|
|
663
|
15
|
|
|
|
|
116
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
39
|
|
664
|
|
|
|
|
|
|
} |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
sub pdml { |
667
|
232
|
|
|
234
|
1
|
1553
|
my ($self, $name, @args) = @_; |
668
|
|
|
|
|
|
|
|
669
|
232
|
|
|
|
|
947
|
my $method = "pdml_for_$name"; |
670
|
|
|
|
|
|
|
|
671
|
232
|
50
|
|
|
|
2172
|
$self->error('on.pdml') if !$self->can($method); |
672
|
|
|
|
|
|
|
|
673
|
232
|
100
|
|
|
|
2152
|
wantarray ? ($self->$method(@args)) : $self->$method(@args); |
674
|
|
|
|
|
|
|
} |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
sub pdml_for_abstract { |
677
|
16
|
|
|
18
|
0
|
118
|
my ($self) = @_; |
678
|
|
|
|
|
|
|
|
679
|
16
|
|
|
|
|
62
|
my $output; |
680
|
|
|
|
|
|
|
|
681
|
16
|
|
|
|
|
386
|
my $text = $self->text('abstract'); |
682
|
|
|
|
|
|
|
|
683
|
16
|
50
|
|
|
|
155
|
return $text ? ($self->head1('abstract', $text)) : (); |
684
|
|
|
|
|
|
|
} |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
sub pdml_for_attribute_type1 { |
687
|
15
|
|
|
16
|
0
|
39
|
my ($self, $name, $is, $pre, $isa, $def) = @_; |
688
|
|
|
|
|
|
|
|
689
|
15
|
|
|
|
|
199
|
my @output; |
690
|
|
|
|
|
|
|
|
691
|
15
|
0
|
|
|
|
145
|
$is = $is eq 'ro' ? 'read-only' : 'read-write'; |
692
|
15
|
0
|
|
|
|
56
|
$pre = $pre eq 'req' ? 'required' : 'optional'; |
693
|
|
|
|
|
|
|
|
694
|
15
|
|
|
|
|
525
|
push @output, " $name($isa)\n"; |
695
|
15
|
0
|
|
|
|
136
|
push @output, "This attribute is $is, accepts C<($isa)> values, ". ( |
696
|
|
|
|
|
|
|
$def ? "is $pre, and defaults to $def." : "and is $pre." |
697
|
|
|
|
|
|
|
); |
698
|
|
|
|
|
|
|
|
699
|
15
|
|
|
|
|
38
|
return ($self->head2($name, @output)); |
700
|
|
|
|
|
|
|
} |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
sub pdml_for_attribute_type2 { |
703
|
15
|
|
|
16
|
0
|
293
|
my ($self, $name) = @_; |
704
|
|
|
|
|
|
|
|
705
|
15
|
|
|
|
|
106
|
my @output; |
706
|
|
|
|
|
|
|
|
707
|
15
|
|
|
|
|
46
|
my $metadata = $self->text('metadata', $name); |
708
|
15
|
|
|
|
|
364
|
my $signature = $self->text('signature', $name); |
709
|
|
|
|
|
|
|
|
710
|
15
|
0
|
|
|
|
108
|
push @output, ($signature, '') if $signature; |
711
|
|
|
|
|
|
|
|
712
|
15
|
|
|
|
|
48
|
my $text = $self->text('attribute', $name); |
713
|
|
|
|
|
|
|
|
714
|
15
|
0
|
|
|
|
400
|
return () if !$text; |
715
|
|
|
|
|
|
|
|
716
|
15
|
|
|
|
|
128
|
push @output, $text; |
717
|
|
|
|
|
|
|
|
718
|
15
|
0
|
|
|
|
37
|
if ($metadata) { |
719
|
15
|
|
|
|
|
388
|
local $@; |
720
|
15
|
0
|
|
|
|
119
|
if ($metadata = eval $metadata) { |
721
|
15
|
0
|
|
|
|
49
|
if (my $since = $metadata->{since}) { |
722
|
15
|
|
|
|
|
225
|
push @output, "", "I>"; |
723
|
|
|
|
|
|
|
} |
724
|
|
|
|
|
|
|
} |
725
|
|
|
|
|
|
|
} |
726
|
|
|
|
|
|
|
|
727
|
15
|
|
|
|
|
111
|
my @results = $self->search({name => $name}); |
728
|
|
|
|
|
|
|
|
729
|
15
|
|
0
|
|
|
37
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
15
|
|
|
|
|
624
|
|
730
|
15
|
|
|
|
|
94
|
push @output, $self->pdml('example', $i, $name), |
731
|
|
|
|
|
|
|
} |
732
|
|
|
|
|
|
|
|
733
|
15
|
|
|
|
|
40
|
return ($self->head2($name, @output)); |
734
|
|
|
|
|
|
|
} |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
sub pdml_for_attributes { |
737
|
16
|
|
|
17
|
0
|
195
|
my ($self) = @_; |
738
|
|
|
|
|
|
|
|
739
|
16
|
50
|
|
|
|
106
|
my $method = $self->text('attributes') |
740
|
|
|
|
|
|
|
? 'pdml_for_attributes_type1' |
741
|
|
|
|
|
|
|
: 'pdml_for_attributes_type2'; |
742
|
|
|
|
|
|
|
|
743
|
16
|
|
|
|
|
67
|
return $self->$method; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
sub pdml_for_attributes_type1 { |
747
|
15
|
|
|
16
|
0
|
436
|
my ($self) = @_; |
748
|
|
|
|
|
|
|
|
749
|
15
|
|
|
|
|
150
|
my @output; |
750
|
|
|
|
|
|
|
|
751
|
15
|
|
|
|
|
41
|
my $text = $self->text('attributes'); |
752
|
|
|
|
|
|
|
|
753
|
15
|
0
|
|
|
|
426
|
return () if !$text; |
754
|
|
|
|
|
|
|
|
755
|
15
|
|
|
|
|
122
|
for my $line (split /\r?\n/, $text) { |
756
|
|
|
|
|
|
|
push @output, $self->pdml('attribute_type1', ( |
757
|
15
|
|
|
|
|
49
|
map { split /,\s*/ } split /:\s*/, $line, 2 |
|
15
|
|
|
|
|
470
|
|
758
|
|
|
|
|
|
|
)); |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
|
761
|
15
|
0
|
|
|
|
123
|
return () if !@output; |
762
|
|
|
|
|
|
|
|
763
|
15
|
0
|
|
|
|
60
|
if (@output) { |
764
|
15
|
|
0
|
|
|
325
|
unshift @output, $self->head1('attributes', |
765
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'attribute') |
766
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'attributes') |
767
|
|
|
|
|
|
|
|| 'This package has the following attributes:', |
768
|
|
|
|
|
|
|
); |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
|
771
|
15
|
|
|
|
|
126
|
return join "\n", @output; |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
sub pdml_for_attributes_type2 { |
775
|
16
|
|
|
16
|
0
|
61
|
my ($self) = @_; |
776
|
|
|
|
|
|
|
|
777
|
16
|
|
|
|
|
471
|
my @output; |
778
|
|
|
|
|
|
|
|
779
|
16
|
|
|
|
|
132
|
for my $list ($self->search({list => 'attribute'})) { |
780
|
15
|
|
|
|
|
46
|
push @output, $self->pdml('attribute_type2', $list->{name}); |
781
|
|
|
|
|
|
|
} |
782
|
|
|
|
|
|
|
|
783
|
16
|
50
|
|
|
|
290
|
if (@output) { |
784
|
15
|
|
0
|
|
|
115
|
unshift @output, $self->head1('attributes', |
785
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'attribute') |
786
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'attributes') |
787
|
|
|
|
|
|
|
|| 'This package has the following attributes:', |
788
|
|
|
|
|
|
|
); |
789
|
|
|
|
|
|
|
} |
790
|
|
|
|
|
|
|
|
791
|
16
|
|
|
|
|
57
|
return join "\n", @output; |
792
|
|
|
|
|
|
|
} |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
sub pdml_for_authors { |
795
|
103
|
|
|
103
|
0
|
836
|
my ($self) = @_; |
796
|
|
|
|
|
|
|
|
797
|
103
|
|
|
|
|
314
|
my $output; |
798
|
|
|
|
|
|
|
|
799
|
103
|
|
|
|
|
623
|
my $text = $self->text('authors'); |
800
|
|
|
|
|
|
|
|
801
|
103
|
100
|
|
|
|
1466
|
return $text ? ($self->head1('authors', $text)) : (); |
802
|
|
|
|
|
|
|
} |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
sub pdml_for_description { |
805
|
15
|
|
|
16
|
0
|
106
|
my ($self) = @_; |
806
|
|
|
|
|
|
|
|
807
|
15
|
|
|
|
|
43
|
my $output; |
808
|
|
|
|
|
|
|
|
809
|
15
|
|
|
|
|
278
|
my $text = $self->text('description'); |
810
|
|
|
|
|
|
|
|
811
|
15
|
50
|
|
|
|
114
|
return $text ? ($self->head1('description', $text)) : (); |
812
|
|
|
|
|
|
|
} |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
sub pdml_for_encoding { |
815
|
15
|
|
|
16
|
0
|
40
|
my ($self) = @_; |
816
|
|
|
|
|
|
|
|
817
|
15
|
|
|
|
|
374
|
my $output; |
818
|
|
|
|
|
|
|
|
819
|
15
|
|
|
|
|
97
|
my $text = $self->text('encoding'); |
820
|
|
|
|
|
|
|
|
821
|
15
|
50
|
|
|
|
42
|
return $text ? ($self->encoding($text)) : (); |
822
|
|
|
|
|
|
|
} |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
sub pdml_for_error { |
825
|
14
|
|
|
15
|
0
|
398
|
my ($self, $name) = @_; |
826
|
|
|
|
|
|
|
|
827
|
14
|
|
|
|
|
130
|
my @output; |
828
|
|
|
|
|
|
|
|
829
|
14
|
|
|
|
|
53
|
my $text = $self->text('error', $name); |
830
|
|
|
|
|
|
|
|
831
|
14
|
0
|
|
|
|
186
|
return () if !$text; |
832
|
|
|
|
|
|
|
|
833
|
13
|
|
|
|
|
100
|
my @results = $self->search({name => $name}); |
834
|
|
|
|
|
|
|
|
835
|
13
|
|
0
|
|
|
33
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
13
|
|
|
|
|
466
|
|
836
|
13
|
|
|
|
|
88
|
push @output, "B", $self->text('example', $i, $name); |
837
|
|
|
|
|
|
|
} |
838
|
|
|
|
|
|
|
|
839
|
13
|
|
|
|
|
34
|
return ($self->over($self->item("error: C<$name>", join "\n\n", $text, @output))); |
840
|
|
|
|
|
|
|
} |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
sub pdml_for_errors { |
843
|
14
|
|
|
16
|
0
|
319
|
my ($self) = @_; |
844
|
|
|
|
|
|
|
|
845
|
14
|
|
|
|
|
104
|
my @output; |
846
|
|
|
|
|
|
|
|
847
|
14
|
|
|
|
|
37
|
for my $list ($self->search({list => 'error'})) { |
848
|
13
|
|
|
|
|
219
|
push @output, $self->pdml('error', $list->{name}); |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
14
|
50
|
|
|
|
125
|
if (@output) { |
852
|
13
|
|
0
|
|
|
28
|
unshift @output, $self->head1('errors', |
853
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'error') |
854
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'errors') |
855
|
|
|
|
|
|
|
|| 'This package may raise the following errors:', |
856
|
|
|
|
|
|
|
); |
857
|
|
|
|
|
|
|
} |
858
|
|
|
|
|
|
|
|
859
|
14
|
|
|
|
|
364
|
return join "\n", @output; |
860
|
|
|
|
|
|
|
} |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
sub pdml_for_example { |
863
|
28
|
|
|
30
|
0
|
134
|
my ($self, $number, $name) = @_; |
864
|
|
|
|
|
|
|
|
865
|
28
|
|
|
|
|
59
|
my @output; |
866
|
|
|
|
|
|
|
|
867
|
28
|
|
|
|
|
384
|
my $text = $self->text('example', $number, $name); |
868
|
|
|
|
|
|
|
|
869
|
28
|
50
|
|
|
|
174
|
return $text ? ($self->over($self->item("$name example $number", $text))) : (); |
870
|
|
|
|
|
|
|
} |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
sub pdml_for_feature { |
873
|
13
|
|
|
15
|
0
|
37
|
my ($self, $name) = @_; |
874
|
|
|
|
|
|
|
|
875
|
13
|
|
|
|
|
169
|
my @output; |
876
|
|
|
|
|
|
|
|
877
|
13
|
|
|
|
|
98
|
my $signature = $self->text('signature', $name); |
878
|
|
|
|
|
|
|
|
879
|
13
|
0
|
|
|
|
29
|
push @output, ($signature, '') if $signature; |
880
|
|
|
|
|
|
|
|
881
|
13
|
|
|
|
|
467
|
my $text = $self->text('feature', $name); |
882
|
|
|
|
|
|
|
|
883
|
13
|
0
|
|
|
|
92
|
return () if !$text; |
884
|
|
|
|
|
|
|
|
885
|
13
|
|
|
|
|
54
|
my @results = $self->search({name => $name}); |
886
|
|
|
|
|
|
|
|
887
|
13
|
|
0
|
|
|
291
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
13
|
|
|
|
|
101
|
|
888
|
13
|
|
|
|
|
44
|
push @output, "B", $self->text('example', $i, $name); |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
|
891
|
13
|
|
|
|
|
241
|
return ($self->over($self->item($name, join "\n\n", $text, @output))); |
892
|
|
|
|
|
|
|
} |
893
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
sub pdml_for_features { |
895
|
13
|
|
|
16
|
0
|
102
|
my ($self) = @_; |
896
|
|
|
|
|
|
|
|
897
|
13
|
|
|
|
|
51
|
my @output; |
898
|
|
|
|
|
|
|
|
899
|
13
|
|
|
|
|
279
|
for my $list ($self->search({list => 'feature'})) { |
900
|
12
|
|
|
|
|
89
|
push @output, $self->pdml('feature', $list->{name}); |
901
|
|
|
|
|
|
|
} |
902
|
|
|
|
|
|
|
|
903
|
13
|
50
|
|
|
|
38
|
if (@output) { |
904
|
12
|
|
0
|
|
|
364
|
unshift @output, $self->head1('features', |
905
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'feature') |
906
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'features') |
907
|
|
|
|
|
|
|
|| 'This package provides the following features:', |
908
|
|
|
|
|
|
|
); |
909
|
|
|
|
|
|
|
} |
910
|
|
|
|
|
|
|
|
911
|
13
|
|
|
|
|
102
|
return join "\n", @output; |
912
|
|
|
|
|
|
|
} |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
sub pdml_for_function { |
915
|
13
|
|
|
16
|
0
|
56
|
my ($self, $name) = @_; |
916
|
|
|
|
|
|
|
|
917
|
13
|
|
|
|
|
186
|
my @output; |
918
|
|
|
|
|
|
|
|
919
|
12
|
|
|
|
|
84
|
my $metadata = $self->text('metadata', $name); |
920
|
12
|
|
|
|
|
34
|
my $signature = $self->text('signature', $name); |
921
|
|
|
|
|
|
|
|
922
|
12
|
50
|
|
|
|
490
|
push @output, ($signature, '') if $signature; |
923
|
|
|
|
|
|
|
|
924
|
12
|
|
|
|
|
82
|
my $text = $self->text('function', $name); |
925
|
|
|
|
|
|
|
|
926
|
12
|
50
|
|
|
|
27
|
return () if !$text; |
927
|
|
|
|
|
|
|
|
928
|
12
|
|
|
|
|
154
|
push @output, $text; |
929
|
|
|
|
|
|
|
|
930
|
12
|
50
|
|
|
|
76
|
if ($metadata) { |
931
|
12
|
|
|
|
|
33
|
local $@; |
932
|
12
|
50
|
|
|
|
517
|
if ($metadata = eval $metadata) { |
933
|
12
|
50
|
|
|
|
77
|
if (my $since = $metadata->{since}) { |
934
|
12
|
|
|
|
|
36
|
push @output, "", "I>"; |
935
|
|
|
|
|
|
|
} |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
} |
938
|
|
|
|
|
|
|
|
939
|
12
|
|
|
|
|
316
|
my @results = $self->search({name => $name}); |
940
|
|
|
|
|
|
|
|
941
|
12
|
|
50
|
|
|
100
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
15
|
|
|
|
|
365
|
|
942
|
12
|
|
|
|
|
538
|
push @output, $self->pdml('example', $i, $name), |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
12
|
|
|
|
|
84
|
return ($self->head2($name, @output)); |
946
|
|
|
|
|
|
|
} |
947
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
sub pdml_for_functions { |
949
|
12
|
|
|
16
|
0
|
32
|
my ($self) = @_; |
950
|
|
|
|
|
|
|
|
951
|
12
|
|
|
|
|
202
|
my @output; |
952
|
|
|
|
|
|
|
|
953
|
12
|
|
|
|
|
98
|
my $type = 'function'; |
954
|
12
|
|
|
|
|
44
|
my $text = $self->text('includes'); |
955
|
|
|
|
|
|
|
|
956
|
12
|
|
|
|
|
593
|
for my $name (sort map /:\s*(\w+)$/, grep /^$type/, split /\r?\n/, $text) { |
957
|
12
|
|
|
|
|
90
|
push @output, $self->pdml($type, $name); |
958
|
|
|
|
|
|
|
} |
959
|
|
|
|
|
|
|
|
960
|
12
|
50
|
|
|
|
34
|
if (@output) { |
961
|
12
|
|
50
|
|
|
168
|
unshift @output, $self->head1('functions', |
962
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'function') |
963
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'functions') |
964
|
|
|
|
|
|
|
|| 'This package provides the following functions:', |
965
|
|
|
|
|
|
|
); |
966
|
|
|
|
|
|
|
} |
967
|
|
|
|
|
|
|
|
968
|
12
|
|
|
|
|
91
|
return join "\n", @output; |
969
|
|
|
|
|
|
|
} |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
sub pdml_for_include { |
972
|
11
|
|
|
15
|
0
|
28
|
my ($self) = @_; |
973
|
|
|
|
|
|
|
|
974
|
11
|
|
|
|
|
348
|
my $output; |
975
|
|
|
|
|
|
|
|
976
|
11
|
|
|
|
|
115
|
my $text = $self->text('include'); |
977
|
|
|
|
|
|
|
|
978
|
11
|
|
|
|
|
39
|
return $output; |
979
|
|
|
|
|
|
|
} |
980
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
sub pdml_for_includes { |
982
|
11
|
|
|
15
|
0
|
213
|
my ($self) = @_; |
983
|
|
|
|
|
|
|
|
984
|
11
|
|
|
|
|
75
|
my $output; |
985
|
|
|
|
|
|
|
|
986
|
11
|
|
|
|
|
30
|
my $text = $self->text('includes'); |
987
|
|
|
|
|
|
|
|
988
|
11
|
|
|
|
|
333
|
return $output; |
989
|
|
|
|
|
|
|
} |
990
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
sub pdml_for_inherits { |
992
|
12
|
|
|
16
|
0
|
95
|
my ($self) = @_; |
993
|
|
|
|
|
|
|
|
994
|
12
|
|
|
|
|
34
|
my $text = $self->text('inherits'); |
995
|
|
|
|
|
|
|
|
996
|
12
|
|
|
|
|
209
|
my @output = map +($self->link($_), ""), grep defined, |
997
|
|
|
|
|
|
|
split /\r?\n/, $self->text('inherits'); |
998
|
|
|
|
|
|
|
|
999
|
12
|
50
|
|
|
|
91
|
return '' if !@output; |
1000
|
|
|
|
|
|
|
|
1001
|
12
|
|
|
|
|
28
|
pop @output; |
1002
|
|
|
|
|
|
|
|
1003
|
12
|
|
|
|
|
471
|
return $self->head1('inherits', |
1004
|
|
|
|
|
|
|
"This package inherits behaviors from:", |
1005
|
|
|
|
|
|
|
"", |
1006
|
|
|
|
|
|
|
@output, |
1007
|
|
|
|
|
|
|
); |
1008
|
|
|
|
|
|
|
} |
1009
|
|
|
|
|
|
|
|
1010
|
|
|
|
|
|
|
sub pdml_for_integrates { |
1011
|
12
|
|
|
16
|
0
|
105
|
my ($self) = @_; |
1012
|
|
|
|
|
|
|
|
1013
|
12
|
|
|
|
|
27
|
my $text = $self->text('integrates'); |
1014
|
|
|
|
|
|
|
|
1015
|
12
|
|
|
|
|
141
|
my @output = map +($self->link($_), ""), grep defined, |
1016
|
|
|
|
|
|
|
split /\r?\n/, $self->text('integrates'); |
1017
|
|
|
|
|
|
|
|
1018
|
12
|
50
|
|
|
|
109
|
return '' if !@output; |
1019
|
|
|
|
|
|
|
|
1020
|
12
|
|
|
|
|
50
|
pop @output; |
1021
|
|
|
|
|
|
|
|
1022
|
12
|
|
|
|
|
393
|
return $self->head1('integrates', |
1023
|
|
|
|
|
|
|
"This package integrates behaviors from:", |
1024
|
|
|
|
|
|
|
"", |
1025
|
|
|
|
|
|
|
@output, |
1026
|
|
|
|
|
|
|
); |
1027
|
|
|
|
|
|
|
} |
1028
|
|
|
|
|
|
|
|
1029
|
|
|
|
|
|
|
sub pdml_for_libraries { |
1030
|
12
|
|
|
16
|
0
|
85
|
my ($self) = @_; |
1031
|
|
|
|
|
|
|
|
1032
|
12
|
|
|
|
|
33
|
my $text = $self->text('libraries'); |
1033
|
|
|
|
|
|
|
|
1034
|
12
|
|
|
|
|
282
|
my @output = map +($self->link($_), ""), grep defined, |
1035
|
|
|
|
|
|
|
split /\r?\n/, $self->text('libraries'); |
1036
|
|
|
|
|
|
|
|
1037
|
12
|
50
|
|
|
|
97
|
return '' if !@output; |
1038
|
|
|
|
|
|
|
|
1039
|
11
|
|
|
|
|
30
|
pop @output; |
1040
|
|
|
|
|
|
|
|
1041
|
11
|
|
|
|
|
325
|
return $self->head1('libraries', |
1042
|
|
|
|
|
|
|
"This package uses type constraints from:", |
1043
|
|
|
|
|
|
|
"", |
1044
|
|
|
|
|
|
|
@output, |
1045
|
|
|
|
|
|
|
); |
1046
|
|
|
|
|
|
|
} |
1047
|
|
|
|
|
|
|
|
1048
|
|
|
|
|
|
|
sub pdml_for_license { |
1049
|
99
|
|
|
103
|
0
|
482
|
my ($self) = @_; |
1050
|
|
|
|
|
|
|
|
1051
|
99
|
|
|
|
|
278
|
my $output; |
1052
|
|
|
|
|
|
|
|
1053
|
99
|
|
|
|
|
864
|
my $text = $self->text('license'); |
1054
|
|
|
|
|
|
|
|
1055
|
99
|
100
|
|
|
|
1146
|
return $text ? ($self->head1('license', $text)) : (); |
1056
|
|
|
|
|
|
|
} |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
sub pdml_for_message { |
1059
|
11
|
|
|
15
|
0
|
28
|
my ($self, $name) = @_; |
1060
|
|
|
|
|
|
|
|
1061
|
11
|
|
|
|
|
369
|
my @output; |
1062
|
|
|
|
|
|
|
|
1063
|
11
|
|
|
|
|
69
|
my $signature = $self->text('signature', $name); |
1064
|
|
|
|
|
|
|
|
1065
|
11
|
0
|
|
|
|
22
|
push @output, ($signature, '') if $signature; |
1066
|
|
|
|
|
|
|
|
1067
|
11
|
|
|
|
|
120
|
my $text = $self->text('message', $name); |
1068
|
|
|
|
|
|
|
|
1069
|
11
|
0
|
|
|
|
98
|
return () if !$text; |
1070
|
|
|
|
|
|
|
|
1071
|
11
|
|
|
|
|
36
|
my @results = $self->search({name => $name}); |
1072
|
|
|
|
|
|
|
|
1073
|
11
|
|
0
|
|
|
406
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
11
|
|
|
|
|
90
|
|
1074
|
11
|
|
|
|
|
27
|
push @output, "B", $self->text('example', $i, $name); |
1075
|
|
|
|
|
|
|
} |
1076
|
|
|
|
|
|
|
|
1077
|
11
|
|
|
|
|
227
|
return ($self->over($self->item($name, join "\n\n", $text, @output))); |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
sub pdml_for_messages { |
1081
|
12
|
|
|
16
|
0
|
83
|
my ($self) = @_; |
1082
|
|
|
|
|
|
|
|
1083
|
12
|
|
|
|
|
33
|
my @output; |
1084
|
|
|
|
|
|
|
|
1085
|
12
|
|
|
|
|
258
|
for my $list ($self->search({list => 'message'})) { |
1086
|
11
|
|
|
|
|
80
|
push @output, $self->pdml('message', $list->{name}); |
1087
|
|
|
|
|
|
|
} |
1088
|
|
|
|
|
|
|
|
1089
|
12
|
50
|
|
|
|
38
|
if (@output) { |
1090
|
11
|
|
0
|
|
|
349
|
unshift @output, $self->head1('messages', |
1091
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'message') |
1092
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'messages') |
1093
|
|
|
|
|
|
|
|| 'This package provides the following messages:', |
1094
|
|
|
|
|
|
|
); |
1095
|
|
|
|
|
|
|
} |
1096
|
|
|
|
|
|
|
|
1097
|
12
|
|
|
|
|
82
|
return join "\n", @output; |
1098
|
|
|
|
|
|
|
} |
1099
|
|
|
|
|
|
|
|
1100
|
|
|
|
|
|
|
sub pdml_for_method { |
1101
|
16
|
|
|
20
|
0
|
44
|
my ($self, $name) = @_; |
1102
|
|
|
|
|
|
|
|
1103
|
16
|
|
|
|
|
291
|
my @output; |
1104
|
|
|
|
|
|
|
|
1105
|
16
|
|
|
|
|
92
|
my $metadata = $self->text('metadata', $name); |
1106
|
16
|
|
|
|
|
52
|
my $signature = $self->text('signature', $name); |
1107
|
|
|
|
|
|
|
|
1108
|
16
|
50
|
|
|
|
179
|
push @output, ($signature, '') if $signature; |
1109
|
|
|
|
|
|
|
|
1110
|
16
|
|
|
|
|
144
|
my $text = $self->text('method', $name); |
1111
|
|
|
|
|
|
|
|
1112
|
16
|
50
|
|
|
|
53
|
return () if !$text; |
1113
|
|
|
|
|
|
|
|
1114
|
16
|
|
|
|
|
447
|
push @output, $text; |
1115
|
|
|
|
|
|
|
|
1116
|
16
|
50
|
|
|
|
90
|
if ($metadata) { |
1117
|
16
|
|
|
|
|
39
|
local $@; |
1118
|
16
|
50
|
|
|
|
615
|
if ($metadata = eval $metadata) { |
1119
|
16
|
50
|
|
|
|
107
|
if (my $since = $metadata->{since}) { |
1120
|
16
|
|
|
|
|
76
|
push @output, "", "I>"; |
1121
|
|
|
|
|
|
|
} |
1122
|
|
|
|
|
|
|
} |
1123
|
|
|
|
|
|
|
} |
1124
|
|
|
|
|
|
|
|
1125
|
16
|
|
|
|
|
246
|
my @results = $self->search({name => $name}); |
1126
|
|
|
|
|
|
|
|
1127
|
16
|
|
50
|
|
|
98
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
39
|
|
|
|
|
138
|
|
1128
|
24
|
|
|
|
|
361
|
push @output, $self->pdml('example', $i, $name), |
1129
|
|
|
|
|
|
|
} |
1130
|
|
|
|
|
|
|
|
1131
|
16
|
|
|
|
|
105
|
return ($self->head2($name, @output)); |
1132
|
|
|
|
|
|
|
} |
1133
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
sub pdml_for_methods { |
1135
|
12
|
|
|
16
|
0
|
43
|
my ($self) = @_; |
1136
|
|
|
|
|
|
|
|
1137
|
12
|
|
|
|
|
283
|
my @output; |
1138
|
|
|
|
|
|
|
|
1139
|
12
|
|
|
|
|
81
|
my $type = 'method'; |
1140
|
12
|
|
|
|
|
45
|
my $text = $self->text('includes'); |
1141
|
|
|
|
|
|
|
|
1142
|
12
|
|
|
|
|
233
|
for my $name (sort map /:\s*(\w+)$/, grep /^$type/, split /\r?\n/, $text) { |
1143
|
16
|
|
|
|
|
99
|
push @output, $self->pdml($type, $name); |
1144
|
|
|
|
|
|
|
} |
1145
|
|
|
|
|
|
|
|
1146
|
12
|
50
|
|
|
|
55
|
if (@output) { |
1147
|
12
|
|
50
|
|
|
378
|
unshift @output, $self->head1('methods', |
1148
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'method') |
1149
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'methods') |
1150
|
|
|
|
|
|
|
|| 'This package provides the following methods:', |
1151
|
|
|
|
|
|
|
); |
1152
|
|
|
|
|
|
|
} |
1153
|
|
|
|
|
|
|
|
1154
|
12
|
|
|
|
|
93
|
return join "\n", @output; |
1155
|
|
|
|
|
|
|
} |
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
sub pdml_for_name { |
1158
|
13
|
|
|
17
|
0
|
39
|
my ($self) = @_; |
1159
|
|
|
|
|
|
|
|
1160
|
13
|
|
|
|
|
268
|
my $output; |
1161
|
|
|
|
|
|
|
|
1162
|
12
|
|
|
|
|
84
|
my $name = join ' - ', map $self->text($_), 'name', 'tagline'; |
1163
|
|
|
|
|
|
|
|
1164
|
12
|
50
|
|
|
|
52
|
return $name ? ($self->head1('name', $name)) : (); |
1165
|
|
|
|
|
|
|
} |
1166
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
sub pdml_for_operator { |
1168
|
10
|
|
|
15
|
0
|
236
|
my ($self, $name) = @_; |
1169
|
|
|
|
|
|
|
|
1170
|
10
|
|
|
|
|
66
|
my @output; |
1171
|
|
|
|
|
|
|
|
1172
|
10
|
|
|
|
|
29
|
my $text = $self->text('operator', $name); |
1173
|
|
|
|
|
|
|
|
1174
|
10
|
0
|
|
|
|
227
|
return () if !$text; |
1175
|
|
|
|
|
|
|
|
1176
|
10
|
|
|
|
|
75
|
my @results = $self->search({name => $name}); |
1177
|
|
|
|
|
|
|
|
1178
|
10
|
|
0
|
|
|
45
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
10
|
|
|
|
|
292
|
|
1179
|
10
|
|
|
|
|
73
|
push @output, "B", $self->text('example', $i, $name); |
1180
|
|
|
|
|
|
|
} |
1181
|
|
|
|
|
|
|
|
1182
|
10
|
|
|
|
|
29
|
return ($self->over($self->item("operation: C<$name>", join "\n\n", $text, @output))); |
1183
|
|
|
|
|
|
|
} |
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
sub pdml_for_operators { |
1186
|
11
|
|
|
16
|
0
|
188
|
my ($self) = @_; |
1187
|
|
|
|
|
|
|
|
1188
|
11
|
|
|
|
|
81
|
my @output; |
1189
|
|
|
|
|
|
|
|
1190
|
11
|
|
|
|
|
42
|
for my $list ($self->search({list => 'operator'})) { |
1191
|
10
|
|
|
|
|
288
|
push @output, $self->pdml('operator', $list->{name}); |
1192
|
|
|
|
|
|
|
} |
1193
|
|
|
|
|
|
|
|
1194
|
11
|
50
|
|
|
|
82
|
if (@output) { |
1195
|
10
|
|
0
|
|
|
37
|
unshift @output, $self->head1('operators', |
1196
|
|
|
|
|
|
|
$self->safe('text', 'heading', 'operator') |
1197
|
|
|
|
|
|
|
|| $self->safe('text', 'heading', 'operators') |
1198
|
|
|
|
|
|
|
|| 'This package overloads the following operators:', |
1199
|
|
|
|
|
|
|
); |
1200
|
|
|
|
|
|
|
} |
1201
|
|
|
|
|
|
|
|
1202
|
11
|
|
|
|
|
212
|
return join "\n", @output; |
1203
|
|
|
|
|
|
|
} |
1204
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
sub pdml_for_partials { |
1206
|
11
|
|
|
16
|
0
|
77
|
my ($self) = @_; |
1207
|
|
|
|
|
|
|
|
1208
|
11
|
|
|
|
|
35
|
my $output; |
1209
|
|
|
|
|
|
|
|
1210
|
11
|
|
|
|
|
296
|
my $text = $self->text('partials'); |
1211
|
|
|
|
|
|
|
|
1212
|
11
|
50
|
|
|
|
125
|
return $text ? ($text) : (); |
1213
|
|
|
|
|
|
|
} |
1214
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
sub pdml_for_project { |
1216
|
11
|
|
|
16
|
0
|
42
|
my ($self) = @_; |
1217
|
|
|
|
|
|
|
|
1218
|
11
|
|
|
|
|
205
|
my $output; |
1219
|
|
|
|
|
|
|
|
1220
|
11
|
|
|
|
|
87
|
my $text = $self->text('project'); |
1221
|
|
|
|
|
|
|
|
1222
|
11
|
50
|
|
|
|
55
|
return $text ? ($self->head1('project', $text)) : (); |
1223
|
|
|
|
|
|
|
} |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
sub pdml_for_synopsis { |
1226
|
12
|
|
|
17
|
0
|
363
|
my ($self) = @_; |
1227
|
|
|
|
|
|
|
|
1228
|
12
|
|
|
|
|
83
|
my $output; |
1229
|
|
|
|
|
|
|
|
1230
|
12
|
|
|
|
|
32
|
my $text = $self->text('synopsis'); |
1231
|
|
|
|
|
|
|
|
1232
|
12
|
50
|
|
|
|
162
|
return $text ? ($self->head1('synopsis', $text)) : (); |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
sub pdml_for_tagline { |
1236
|
10
|
|
|
15
|
0
|
68
|
my ($self) = @_; |
1237
|
|
|
|
|
|
|
|
1238
|
10
|
|
|
|
|
27
|
my $output; |
1239
|
|
|
|
|
|
|
|
1240
|
10
|
|
|
|
|
373
|
my $text = $self->text('tagline'); |
1241
|
|
|
|
|
|
|
|
1242
|
10
|
0
|
|
|
|
75
|
return $text ? ($self->head1('tagline', $text)) : (); |
1243
|
|
|
|
|
|
|
} |
1244
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
sub pdml_for_version { |
1246
|
11
|
|
|
16
|
0
|
34
|
my ($self) = @_; |
1247
|
|
|
|
|
|
|
|
1248
|
11
|
|
|
|
|
181
|
my $output; |
1249
|
|
|
|
|
|
|
|
1250
|
11
|
|
|
|
|
96
|
my $text = $self->text('version'); |
1251
|
|
|
|
|
|
|
|
1252
|
11
|
50
|
|
|
|
39
|
return $text ? ($self->head1('version', $text)) : (); |
1253
|
|
|
|
|
|
|
} |
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
sub test_for_abstract { |
1256
|
96
|
|
|
101
|
0
|
617
|
my ($self, $code) = @_; |
1257
|
|
|
|
|
|
|
|
1258
|
96
|
|
|
|
|
451
|
my $data = $self->data('abstract'); |
1259
|
|
|
|
|
|
|
|
1260
|
|
|
|
|
|
|
$code ||= sub { |
1261
|
96
|
|
|
101
|
|
591
|
length($data) > 1; |
1262
|
96
|
|
50
|
|
|
1373
|
}; |
1263
|
|
|
|
|
|
|
|
1264
|
96
|
|
|
|
|
389
|
my $result = $code->(); |
1265
|
|
|
|
|
|
|
|
1266
|
96
|
|
|
|
|
468
|
$self->pass($result, '=abstract'); |
1267
|
|
|
|
|
|
|
|
1268
|
96
|
|
|
|
|
40041
|
return $result; |
1269
|
|
|
|
|
|
|
} |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
sub test_for_attribute { |
1272
|
10
|
|
|
15
|
0
|
67
|
my ($self, $name, $code) = @_; |
1273
|
|
|
|
|
|
|
|
1274
|
10
|
|
|
|
|
31
|
my $data = $self->data('attribute', $name); |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
$code ||= sub { |
1277
|
10
|
|
|
15
|
|
90
|
length($data) > 1; |
1278
|
10
|
|
0
|
|
|
172
|
}; |
1279
|
|
|
|
|
|
|
|
1280
|
10
|
|
|
|
|
30
|
my $result = $code->(); |
1281
|
|
|
|
|
|
|
|
1282
|
10
|
|
|
|
|
374
|
$self->pass($result, "=attribute $name"); |
1283
|
|
|
|
|
|
|
|
1284
|
10
|
|
|
|
|
86
|
my $package = $self->data('name'); |
1285
|
|
|
|
|
|
|
|
1286
|
10
|
|
|
|
|
25
|
$self->pass($package->can($name), "$package has $name"); |
1287
|
|
|
|
|
|
|
|
1288
|
10
|
|
|
|
|
159
|
return $result; |
1289
|
|
|
|
|
|
|
} |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
sub test_for_attributes { |
1292
|
25
|
|
|
30
|
0
|
172
|
my ($self, $code) = @_; |
1293
|
|
|
|
|
|
|
|
1294
|
25
|
|
|
|
|
99
|
my $data = $self->data('attributes'); |
1295
|
25
|
|
|
|
|
376
|
my $package = $self->data('name'); |
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
$code ||= sub { |
1298
|
25
|
|
|
30
|
|
187
|
for my $line (split /\r?\n/, $data) { |
1299
|
61
|
|
|
|
|
14521
|
my ($name, $is, $pre, $isa, $def) = map { split /,\s*/ } split /:\s*/, |
|
112
|
|
|
|
|
511
|
|
1300
|
|
|
|
|
|
|
$line, 2; |
1301
|
61
|
|
|
|
|
578
|
$self->pass($package->can($name), "$package has $name"); |
1302
|
61
|
|
33
|
|
|
21335
|
$self->pass((($is eq 'ro' || $is eq 'rw') |
1303
|
|
|
|
|
|
|
&& ($pre eq 'opt' || $pre eq 'req') |
1304
|
|
|
|
|
|
|
&& $isa), $line); |
1305
|
|
|
|
|
|
|
} |
1306
|
|
|
|
|
|
|
$data |
1307
|
25
|
|
50
|
|
|
336
|
}; |
|
25
|
|
|
|
|
6070
|
|
1308
|
|
|
|
|
|
|
|
1309
|
25
|
|
|
|
|
104
|
my $result = $code->(); |
1310
|
|
|
|
|
|
|
|
1311
|
25
|
|
|
|
|
363
|
$self->pass($result, "=attributes"); |
1312
|
|
|
|
|
|
|
|
1313
|
25
|
|
|
|
|
6006
|
return $result; |
1314
|
|
|
|
|
|
|
} |
1315
|
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
|
sub test_for_authors { |
1317
|
10
|
|
|
15
|
0
|
23
|
my ($self, $code) = @_; |
1318
|
|
|
|
|
|
|
|
1319
|
10
|
|
|
|
|
261
|
my $data = $self->data('authors'); |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
$code ||= sub { |
1322
|
10
|
|
|
15
|
|
28
|
length($data) > 1; |
1323
|
10
|
|
0
|
|
|
77
|
}; |
1324
|
|
|
|
|
|
|
|
1325
|
10
|
|
|
|
|
120
|
my $result = $code->(); |
1326
|
|
|
|
|
|
|
|
1327
|
10
|
|
|
|
|
82
|
$self->pass($result, '=authors'); |
1328
|
|
|
|
|
|
|
|
1329
|
10
|
|
|
|
|
26
|
return $result; |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
sub test_for_description { |
1333
|
96
|
|
|
101
|
0
|
773
|
my ($self, $code) = @_; |
1334
|
|
|
|
|
|
|
|
1335
|
96
|
|
|
|
|
497
|
my $data = $self->data('description'); |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
$code ||= sub { |
1338
|
96
|
|
|
101
|
|
563
|
length($data) > 1; |
1339
|
96
|
|
50
|
|
|
1002
|
}; |
1340
|
|
|
|
|
|
|
|
1341
|
96
|
|
|
|
|
450
|
my $result = $code->(); |
1342
|
|
|
|
|
|
|
|
1343
|
96
|
|
|
|
|
449
|
$self->pass($result, '=description'); |
1344
|
|
|
|
|
|
|
|
1345
|
96
|
|
|
|
|
40400
|
return $result; |
1346
|
|
|
|
|
|
|
} |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
sub test_for_encoding { |
1349
|
10
|
|
|
15
|
0
|
90
|
my ($self, $name, $code) = @_; |
1350
|
|
|
|
|
|
|
|
1351
|
10
|
|
|
|
|
25
|
my $data = $self->data('encoding'); |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
$code ||= sub { |
1354
|
10
|
|
|
15
|
|
83
|
length($data) > 1; |
1355
|
10
|
|
0
|
|
|
248
|
}; |
1356
|
|
|
|
|
|
|
|
1357
|
10
|
|
|
|
|
21
|
my $result = $code->(); |
1358
|
|
|
|
|
|
|
|
1359
|
10
|
|
|
|
|
191
|
$self->pass($result, "=encoding"); |
1360
|
|
|
|
|
|
|
|
1361
|
10
|
|
|
|
|
67
|
return $result; |
1362
|
|
|
|
|
|
|
} |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
sub test_for_error { |
1365
|
40
|
|
|
45
|
0
|
169
|
my ($self, $name, $code) = @_; |
1366
|
|
|
|
|
|
|
|
1367
|
40
|
|
|
|
|
324
|
my $data = $self->data('error', $name); |
1368
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
$code ||= sub { |
1370
|
40
|
|
|
45
|
|
178
|
length($data) > 1; |
1371
|
40
|
|
50
|
|
|
505
|
}; |
1372
|
|
|
|
|
|
|
|
1373
|
40
|
|
|
|
|
433
|
my $result = $code->(); |
1374
|
|
|
|
|
|
|
|
1375
|
40
|
|
|
|
|
293
|
$self->pass($result, "=error $name"); |
1376
|
|
|
|
|
|
|
|
1377
|
40
|
|
|
|
|
15929
|
return $result; |
1378
|
|
|
|
|
|
|
} |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
sub test_for_example { |
1381
|
2706
|
|
|
2711
|
0
|
9672
|
my ($self, $number, $name, $code) = @_; |
1382
|
|
|
|
|
|
|
|
1383
|
2705
|
|
|
|
|
8959
|
my $data = $self->data('example', $number, $name); |
1384
|
|
|
|
|
|
|
|
1385
|
2705
|
|
|
|
|
5899
|
my @includes; |
1386
|
|
|
|
|
|
|
|
1387
|
2705
|
100
|
|
|
|
13208
|
if ($data =~ /# given: synopsis/) { |
1388
|
1053
|
|
|
|
|
4467
|
push @includes, $self->data('synopsis'); |
1389
|
|
|
|
|
|
|
} |
1390
|
|
|
|
|
|
|
|
1391
|
2705
|
|
|
|
|
11673
|
for my $given ($data =~ /# given: example-((?:\d+) (?:[\-\w]+))/gm) { |
1392
|
11
|
|
|
|
|
253
|
my ($number, $name) = split /\s+/, $given, 2; |
1393
|
11
|
|
|
|
|
78
|
push @includes, $self->data('example', $number, $name); |
1394
|
|
|
|
|
|
|
} |
1395
|
|
|
|
|
|
|
|
1396
|
2705
|
|
|
|
|
13913
|
$data =~ s/.*# given: .*\n\n*//g; |
1397
|
|
|
|
|
|
|
|
1398
|
2705
|
|
|
|
|
9970
|
$data = join "\n\n", @includes, $data; |
1399
|
|
|
|
|
|
|
|
1400
|
2705
|
|
|
|
|
9162
|
for my $attest ($data =~ /#\s*attest:\s*\w+:\s*[^\s]+,\s*.*/gm) { |
1401
|
9
|
|
|
|
|
20
|
my ($method, $left, $right) = $attest =~ /attest:\s*(\w+):\s*([^\s]+),\s*(.*)/; |
1402
|
9
|
|
|
|
|
153
|
my $snippet = qq($left = do { $self->pass($left->$method($right), "@{[quotemeta($&)]}"); $left };); |
|
7
|
|
|
|
|
48
|
|
1403
|
7
|
|
|
|
|
19
|
$data =~ s/@{[quotemeta($attest)]}/$snippet/; |
|
7
|
|
|
|
|
200
|
|
1404
|
|
|
|
|
|
|
} |
1405
|
|
|
|
|
|
|
|
1406
|
2703
|
|
50
|
15
|
|
8259
|
$code ||= sub{1}; |
|
7
|
|
|
|
|
23
|
|
1407
|
|
|
|
|
|
|
|
1408
|
2703
|
|
|
|
|
14796
|
my $result = $code->($self->try('eval', $data)); |
1409
|
|
|
|
|
|
|
|
1410
|
2699
|
|
|
|
|
235602
|
$self->pass($data, "=example-$number $name"); |
1411
|
2699
|
|
|
|
|
1091875
|
$self->pass($result, "=example-$number $name returns ok"); |
1412
|
|
|
|
|
|
|
|
1413
|
2699
|
|
|
|
|
1064185
|
return $result; |
1414
|
|
|
|
|
|
|
} |
1415
|
|
|
|
|
|
|
|
1416
|
|
|
|
|
|
|
sub test_for_feature { |
1417
|
22
|
|
|
30
|
0
|
94
|
my ($self, $name, $code) = @_; |
1418
|
|
|
|
|
|
|
|
1419
|
22
|
|
|
|
|
63
|
my $data = $self->data('feature', $name); |
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
$code ||= sub { |
1422
|
22
|
|
|
30
|
|
93
|
length($data) > 1; |
1423
|
22
|
|
50
|
|
|
281
|
}; |
1424
|
|
|
|
|
|
|
|
1425
|
22
|
|
|
|
|
73
|
my $result = $code->(); |
1426
|
|
|
|
|
|
|
|
1427
|
22
|
|
|
|
|
314
|
$self->pass($result, "=feature $name"); |
1428
|
|
|
|
|
|
|
|
1429
|
22
|
|
|
|
|
6462
|
return $result; |
1430
|
|
|
|
|
|
|
} |
1431
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
sub test_for_function { |
1433
|
7
|
|
|
15
|
0
|
17
|
my ($self, $name, $code) = @_; |
1434
|
|
|
|
|
|
|
|
1435
|
7
|
|
|
|
|
223
|
my $data = $self->data('function', $name); |
1436
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
$code ||= sub { |
1438
|
7
|
|
|
14
|
|
23
|
length($data) > 1; |
1439
|
7
|
|
0
|
|
|
40
|
}; |
1440
|
|
|
|
|
|
|
|
1441
|
7
|
|
|
|
|
154
|
my $result = $code->(); |
1442
|
|
|
|
|
|
|
|
1443
|
7
|
|
|
|
|
53
|
$self->pass($result, "=function $name"); |
1444
|
|
|
|
|
|
|
|
1445
|
7
|
|
|
|
|
23
|
return $result; |
1446
|
|
|
|
|
|
|
} |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
sub test_for_include { |
1449
|
927
|
|
|
934
|
0
|
2603
|
my ($self, $text) = @_; |
1450
|
|
|
|
|
|
|
|
1451
|
927
|
|
|
|
|
2437
|
my ($type, $name) = @$text; |
1452
|
|
|
|
|
|
|
|
1453
|
927
|
|
|
|
|
4047
|
my $blocks = [$self->search({ list => $type, name => $name })]; |
1454
|
|
|
|
|
|
|
|
1455
|
927
|
|
|
|
|
7495
|
$self->pass(scalar(@$blocks), "=$type $name"); |
1456
|
|
|
|
|
|
|
|
1457
|
927
|
|
|
|
|
438417
|
return $blocks; |
1458
|
|
|
|
|
|
|
} |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
sub test_for_includes { |
1461
|
88
|
|
|
95
|
0
|
461
|
my ($self, $code) = @_; |
1462
|
|
|
|
|
|
|
|
1463
|
88
|
|
|
|
|
441
|
my $data = $self->data('includes'); |
1464
|
|
|
|
|
|
|
|
1465
|
88
|
|
33
|
|
|
1135
|
$code ||= $self->can('test_for_include'); |
1466
|
|
|
|
|
|
|
|
1467
|
88
|
|
|
|
|
397
|
$self->pass($data, "=includes"); |
1468
|
|
|
|
|
|
|
|
1469
|
88
|
|
|
|
|
38267
|
my $results = []; |
1470
|
|
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
push @$results, $self->$code($_) |
1472
|
88
|
|
|
|
|
3763
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $data; |
1473
|
|
|
|
|
|
|
|
1474
|
88
|
|
|
|
|
928
|
return $results; |
1475
|
|
|
|
|
|
|
} |
1476
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
sub test_for_inherits { |
1478
|
54
|
|
|
61
|
0
|
467
|
my ($self, $code) = @_; |
1479
|
|
|
|
|
|
|
|
1480
|
54
|
|
|
|
|
256
|
my $data = $self->data('inherits'); |
1481
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
$code ||= sub { |
1483
|
54
|
|
|
60
|
|
377
|
length($data) > 1; |
1484
|
54
|
|
50
|
|
|
586
|
}; |
1485
|
|
|
|
|
|
|
|
1486
|
54
|
|
|
|
|
267
|
my $result = $code->(); |
1487
|
|
|
|
|
|
|
|
1488
|
54
|
|
|
|
|
255
|
$self->pass($result, "=inherits"); |
1489
|
|
|
|
|
|
|
|
1490
|
54
|
|
|
|
|
20984
|
my $package = $self->data('name'); |
1491
|
|
|
|
|
|
|
|
1492
|
53
|
|
|
|
|
1151
|
$self->pass($package->isa($_), "$package isa $_") for split /\r?\n/, $data; |
1493
|
|
|
|
|
|
|
|
1494
|
53
|
|
|
|
|
21863
|
return $result; |
1495
|
|
|
|
|
|
|
} |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
sub test_for_integrates { |
1498
|
32
|
|
|
39
|
0
|
367
|
my ($self, $code) = @_; |
1499
|
|
|
|
|
|
|
|
1500
|
32
|
|
|
|
|
158
|
my $data = $self->data('integrates'); |
1501
|
|
|
|
|
|
|
|
1502
|
|
|
|
|
|
|
$code ||= sub { |
1503
|
32
|
|
|
39
|
|
146
|
length($data) > 1; |
1504
|
32
|
|
50
|
|
|
336
|
}; |
1505
|
|
|
|
|
|
|
|
1506
|
31
|
|
|
|
|
139
|
my $result = $code->(); |
1507
|
|
|
|
|
|
|
|
1508
|
31
|
|
|
|
|
225
|
$self->pass($result, "=integrates"); |
1509
|
|
|
|
|
|
|
|
1510
|
31
|
|
|
|
|
11710
|
my $package = $self->data('name'); |
1511
|
|
|
|
|
|
|
|
1512
|
31
|
|
|
|
|
679
|
$self->pass($package->can('does'), "$package has does"); |
1513
|
31
|
|
|
|
|
11354
|
$self->pass($package->does($_), "$package does $_") for split /\r?\n/, $data; |
1514
|
|
|
|
|
|
|
|
1515
|
31
|
|
|
|
|
10637
|
return $result; |
1516
|
|
|
|
|
|
|
} |
1517
|
|
|
|
|
|
|
|
1518
|
|
|
|
|
|
|
sub test_for_libraries { |
1519
|
5
|
|
|
13
|
0
|
57
|
my ($self, $name, $code) = @_; |
1520
|
|
|
|
|
|
|
|
1521
|
5
|
|
|
|
|
21
|
my $data = $self->data('libraries'); |
1522
|
|
|
|
|
|
|
|
1523
|
|
|
|
|
|
|
$code ||= sub { |
1524
|
5
|
|
|
13
|
|
34
|
length($data) > 1; |
1525
|
5
|
|
0
|
|
|
136
|
}; |
1526
|
|
|
|
|
|
|
|
1527
|
5
|
|
|
|
|
11
|
my $result = $code->(); |
1528
|
|
|
|
|
|
|
|
1529
|
5
|
|
|
|
|
115
|
$self->pass($result, "=libraries"); |
1530
|
5
|
|
|
|
|
42
|
$self->pass(scalar(eval("require $_")), "$_ ok") for split /\r?\n/, $data; |
1531
|
|
|
|
|
|
|
|
1532
|
5
|
|
|
|
|
18
|
return $result; |
1533
|
|
|
|
|
|
|
} |
1534
|
|
|
|
|
|
|
|
1535
|
|
|
|
|
|
|
sub test_for_license { |
1536
|
5
|
|
|
13
|
0
|
156
|
my ($self, $name, $code) = @_; |
1537
|
|
|
|
|
|
|
|
1538
|
5
|
|
|
|
|
31
|
my $data = $self->data('license'); |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
$code ||= sub { |
1541
|
5
|
|
|
13
|
|
49
|
length($data) > 1; |
1542
|
5
|
|
0
|
|
|
13
|
}; |
1543
|
|
|
|
|
|
|
|
1544
|
5
|
|
|
|
|
37
|
my $result = $code->(); |
1545
|
|
|
|
|
|
|
|
1546
|
5
|
|
|
|
|
16
|
$self->pass($result, "=license"); |
1547
|
|
|
|
|
|
|
|
1548
|
5
|
|
|
|
|
202
|
return $result; |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
sub test_for_message { |
1552
|
5
|
|
|
13
|
0
|
36
|
my ($self, $name, $code) = @_; |
1553
|
|
|
|
|
|
|
|
1554
|
5
|
|
|
|
|
14
|
my $data = $self->data('message', $name); |
1555
|
|
|
|
|
|
|
|
1556
|
|
|
|
|
|
|
$code ||= sub { |
1557
|
5
|
|
|
13
|
|
39
|
length($data) > 1; |
1558
|
5
|
|
0
|
|
|
80
|
}; |
1559
|
|
|
|
|
|
|
|
1560
|
5
|
|
|
|
|
12
|
my $result = $code->(); |
1561
|
|
|
|
|
|
|
|
1562
|
5
|
|
|
|
|
77
|
$self->pass($result, "=message $name"); |
1563
|
|
|
|
|
|
|
|
1564
|
5
|
|
|
|
|
37
|
return $result; |
1565
|
|
|
|
|
|
|
} |
1566
|
|
|
|
|
|
|
|
1567
|
|
|
|
|
|
|
sub test_for_method { |
1568
|
5
|
|
|
12
|
0
|
14
|
my ($self, $name, $code) = @_; |
1569
|
|
|
|
|
|
|
|
1570
|
5
|
|
|
|
|
145
|
my $data = $self->data('method', $name); |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
$code ||= sub { |
1573
|
5
|
|
|
12
|
|
16
|
length($data) > 1; |
1574
|
5
|
|
0
|
|
|
42
|
}; |
1575
|
|
|
|
|
|
|
|
1576
|
5
|
|
|
|
|
123
|
my $result = $code->(); |
1577
|
|
|
|
|
|
|
|
1578
|
5
|
|
|
|
|
39
|
$self->pass($result, "=method $name"); |
1579
|
|
|
|
|
|
|
|
1580
|
5
|
|
|
|
|
21
|
my $package = $self->data('name'); |
1581
|
|
|
|
|
|
|
|
1582
|
5
|
|
|
|
|
37
|
$self->pass($package->can($name), "$package has $name"); |
1583
|
|
|
|
|
|
|
|
1584
|
5
|
|
|
|
|
49
|
return $result; |
1585
|
|
|
|
|
|
|
} |
1586
|
|
|
|
|
|
|
|
1587
|
|
|
|
|
|
|
sub test_for_name { |
1588
|
91
|
|
|
98
|
0
|
358
|
my ($self, $code) = @_; |
1589
|
|
|
|
|
|
|
|
1590
|
91
|
|
|
|
|
635
|
my $data = $self->data('name'); |
1591
|
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
|
$code ||= sub { |
1593
|
91
|
|
|
97
|
|
373
|
length($data) > 1; |
1594
|
91
|
|
50
|
|
|
1009
|
}; |
1595
|
|
|
|
|
|
|
|
1596
|
91
|
|
|
|
|
424
|
my $result = $code->(); |
1597
|
|
|
|
|
|
|
|
1598
|
91
|
|
|
|
|
580
|
$self->pass($result, $self->desc('=name')); |
1599
|
91
|
|
|
|
|
57944
|
$self->pass(scalar(eval("require $data")), $self->desc('require', $data)); |
1600
|
|
|
|
|
|
|
|
1601
|
91
|
|
|
|
|
38466
|
return $result; |
1602
|
|
|
|
|
|
|
} |
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
sub test_for_operator { |
1605
|
77
|
|
|
83
|
0
|
305
|
my ($self, $name, $code) = @_; |
1606
|
|
|
|
|
|
|
|
1607
|
77
|
|
|
|
|
281
|
my $data = $self->data('operator', $name); |
1608
|
|
|
|
|
|
|
|
1609
|
|
|
|
|
|
|
$code ||= sub { |
1610
|
77
|
|
|
83
|
|
276
|
length($data) > 1; |
1611
|
77
|
|
50
|
|
|
1045
|
}; |
1612
|
|
|
|
|
|
|
|
1613
|
77
|
|
|
|
|
246
|
my $result = $code->(); |
1614
|
|
|
|
|
|
|
|
1615
|
77
|
|
|
|
|
575
|
$self->pass($result, "=operator $name"); |
1616
|
|
|
|
|
|
|
|
1617
|
77
|
|
|
|
|
32383
|
return $result; |
1618
|
|
|
|
|
|
|
} |
1619
|
|
|
|
|
|
|
|
1620
|
|
|
|
|
|
|
sub test_for_partial { |
1621
|
177
|
|
|
183
|
0
|
763
|
my ($self, $text) = @_; |
1622
|
|
|
|
|
|
|
|
1623
|
177
|
|
|
|
|
781
|
my ($file, $method, @args) = @$text; |
1624
|
|
|
|
|
|
|
|
1625
|
177
|
|
|
|
|
1692
|
my $test = $self->class->new($file); |
1626
|
|
|
|
|
|
|
|
1627
|
177
|
|
|
|
|
568
|
my $content; |
1628
|
|
|
|
|
|
|
|
1629
|
177
|
|
33
|
|
|
8025
|
$self->pass((-f $file && ($content = $test->$method(@args))), |
1630
|
|
|
|
|
|
|
"$file: $method: @args"); |
1631
|
|
|
|
|
|
|
|
1632
|
177
|
|
|
|
|
130460
|
return $content; |
1633
|
|
|
|
|
|
|
} |
1634
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
sub test_for_partials { |
1636
|
91
|
|
|
97
|
0
|
466
|
my ($self, $code) = @_; |
1637
|
|
|
|
|
|
|
|
1638
|
91
|
|
|
|
|
493
|
my $data = $self->data('partials'); |
1639
|
|
|
|
|
|
|
|
1640
|
91
|
|
33
|
|
|
1379
|
$code ||= $self->can('test_for_partial'); |
1641
|
|
|
|
|
|
|
|
1642
|
91
|
|
|
|
|
503
|
$self->pass($data, '=partials'); |
1643
|
|
|
|
|
|
|
|
1644
|
91
|
|
|
|
|
38689
|
my $results = []; |
1645
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
push @$results, $self->$code($_) |
1647
|
91
|
|
|
|
|
2606
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $data; |
1648
|
|
|
|
|
|
|
|
1649
|
91
|
|
|
|
|
801
|
return $results; |
1650
|
|
|
|
|
|
|
} |
1651
|
|
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
sub test_for_project { |
1653
|
5
|
|
|
11
|
0
|
48
|
my ($self, $name, $code) = @_; |
1654
|
|
|
|
|
|
|
|
1655
|
5
|
|
|
|
|
40
|
my $data = $self->data('project'); |
1656
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
$code ||= sub { |
1658
|
5
|
|
|
11
|
|
224
|
length($data) > 1; |
1659
|
5
|
|
0
|
|
|
14
|
}; |
1660
|
|
|
|
|
|
|
|
1661
|
5
|
|
|
|
|
30
|
my $result = $code->(); |
1662
|
|
|
|
|
|
|
|
1663
|
5
|
|
|
|
|
14
|
$self->pass($result, "=project"); |
1664
|
|
|
|
|
|
|
|
1665
|
5
|
|
|
|
|
36
|
return $result; |
1666
|
|
|
|
|
|
|
} |
1667
|
|
|
|
|
|
|
|
1668
|
|
|
|
|
|
|
sub test_for_synopsis { |
1669
|
91
|
|
|
97
|
0
|
496
|
my ($self, $code) = @_; |
1670
|
|
|
|
|
|
|
|
1671
|
91
|
|
|
|
|
416
|
my $data = $self->data('synopsis'); |
1672
|
|
|
|
|
|
|
|
1673
|
91
|
|
|
|
|
483
|
my @includes; |
1674
|
|
|
|
|
|
|
|
1675
|
91
|
|
|
|
|
612
|
for my $given ($data =~ /# given: example-((?:\d+) (?:[\-\w]+))/gm) { |
1676
|
5
|
|
|
|
|
12
|
my ($number, $name) = split /\s+/, $given, 2; |
1677
|
5
|
|
|
|
|
78
|
push @includes, $self->data('example', $number, $name); |
1678
|
|
|
|
|
|
|
} |
1679
|
|
|
|
|
|
|
|
1680
|
91
|
|
|
|
|
432
|
$data =~ s/.*# given: .*\n\n*//g; |
1681
|
|
|
|
|
|
|
|
1682
|
91
|
|
|
|
|
393
|
$data = join "\n\n", @includes, $data; |
1683
|
|
|
|
|
|
|
|
1684
|
91
|
|
|
|
|
623
|
for my $attest ($data =~ /#\s*attest:\s*\w+:\s*[^\s]+,\s*.*/gm) { |
1685
|
5
|
|
|
|
|
40
|
my ($method, $left, $right) = $attest =~ /attest:\s*(\w+):\s*([^\s]+),\s*(.*)/; |
1686
|
5
|
|
|
|
|
13
|
my $snippet = qq($left = do { $self->pass($left->$method($right), "@{[quotemeta($&)]}"); $left };); |
|
5
|
|
|
|
|
37
|
|
1687
|
5
|
|
|
|
|
49
|
$data =~ s/@{[quotemeta($attest)]}/$snippet/; |
|
5
|
|
|
|
|
16
|
|
1688
|
|
|
|
|
|
|
} |
1689
|
|
|
|
|
|
|
|
1690
|
91
|
|
50
|
11
|
|
616
|
$code ||= sub{$_[0]->result}; |
|
5
|
|
|
|
|
31
|
|
1691
|
|
|
|
|
|
|
|
1692
|
91
|
|
|
|
|
746
|
my $result = $code->($self->try('eval', $data)); |
1693
|
|
|
|
|
|
|
|
1694
|
91
|
|
|
|
|
4182
|
$self->pass($data, "=synopsis"); |
1695
|
91
|
|
|
|
|
37279
|
$self->pass($result, "=synopsis returns ok"); |
1696
|
|
|
|
|
|
|
|
1697
|
91
|
|
|
|
|
36169
|
return $result; |
1698
|
|
|
|
|
|
|
} |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
sub test_for_tagline { |
1701
|
91
|
|
|
97
|
0
|
713
|
my ($self, $name, $code) = @_; |
1702
|
|
|
|
|
|
|
|
1703
|
91
|
|
|
|
|
441
|
my $data = $self->data('tagline'); |
1704
|
|
|
|
|
|
|
|
1705
|
|
|
|
|
|
|
$code ||= sub { |
1706
|
91
|
|
|
97
|
|
362
|
length($data) > 1; |
1707
|
91
|
|
50
|
|
|
1032
|
}; |
1708
|
|
|
|
|
|
|
|
1709
|
91
|
|
|
|
|
352
|
my $result = $code->(); |
1710
|
|
|
|
|
|
|
|
1711
|
91
|
|
|
|
|
424
|
$self->pass($result, "=tagline"); |
1712
|
|
|
|
|
|
|
|
1713
|
91
|
|
|
|
|
40200
|
return $result; |
1714
|
|
|
|
|
|
|
} |
1715
|
|
|
|
|
|
|
|
1716
|
|
|
|
|
|
|
sub test_for_version { |
1717
|
5
|
|
|
11
|
0
|
37
|
my ($self, $name, $code) = @_; |
1718
|
|
|
|
|
|
|
|
1719
|
5
|
|
|
|
|
14
|
my $data = $self->data('version'); |
1720
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
$code ||= sub { |
1722
|
5
|
|
|
11
|
|
40
|
length($data) > 1; |
1723
|
5
|
|
0
|
|
|
42
|
}; |
1724
|
|
|
|
|
|
|
|
1725
|
5
|
|
|
|
|
14
|
my $result = $code->(); |
1726
|
|
|
|
|
|
|
|
1727
|
5
|
|
|
|
|
253
|
$self->pass($result, "=version"); |
1728
|
|
|
|
|
|
|
|
1729
|
5
|
|
|
|
|
41
|
my $package = $self->data('name'); |
1730
|
|
|
|
|
|
|
|
1731
|
5
|
|
0
|
|
|
13
|
$self->pass(($package->VERSION // '') eq $data, "$data matched"); |
1732
|
|
|
|
|
|
|
|
1733
|
5
|
|
|
|
|
34
|
return $result; |
1734
|
|
|
|
|
|
|
} |
1735
|
|
|
|
|
|
|
|
1736
|
|
|
|
|
|
|
sub text { |
1737
|
245
|
|
|
251
|
1
|
918
|
my ($self, $name, @args) = @_; |
1738
|
|
|
|
|
|
|
|
1739
|
245
|
|
|
|
|
794
|
my $method = "text_for_$name"; |
1740
|
|
|
|
|
|
|
|
1741
|
245
|
100
|
|
|
|
1794
|
$self->error("on.text.$name") if !$self->can($method); |
1742
|
|
|
|
|
|
|
|
1743
|
244
|
|
|
|
|
1719
|
my $result = $self->$method(@args); |
1744
|
|
|
|
|
|
|
|
1745
|
244
|
|
|
|
|
1392
|
return join "\n", @$result; |
1746
|
|
|
|
|
|
|
} |
1747
|
|
|
|
|
|
|
|
1748
|
|
|
|
|
|
|
sub text_for_abstract { |
1749
|
6
|
|
|
12
|
0
|
55
|
my ($self) = @_; |
1750
|
|
|
|
|
|
|
|
1751
|
6
|
|
|
|
|
43
|
my ($error, $result) = $self->catch('data', 'abstract'); |
1752
|
|
|
|
|
|
|
|
1753
|
6
|
|
|
|
|
21
|
my $output = []; |
1754
|
|
|
|
|
|
|
|
1755
|
6
|
50
|
|
|
|
292
|
if (!$error) { |
1756
|
6
|
|
|
|
|
52
|
push @$output, $result; |
1757
|
|
|
|
|
|
|
} |
1758
|
|
|
|
|
|
|
|
1759
|
6
|
|
|
|
|
24
|
return $output; |
1760
|
|
|
|
|
|
|
} |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
sub text_for_attribute { |
1763
|
5
|
|
|
11
|
0
|
48
|
my ($self, $name) = @_; |
1764
|
|
|
|
|
|
|
|
1765
|
4
|
|
|
|
|
32
|
my ($error, $result) = $self->catch('data', 'attribute', $name); |
1766
|
|
|
|
|
|
|
|
1767
|
4
|
|
|
|
|
11
|
my $output = []; |
1768
|
|
|
|
|
|
|
|
1769
|
4
|
0
|
|
|
|
305
|
if (!$error) { |
1770
|
4
|
|
|
|
|
31
|
push @$output, $result; |
1771
|
|
|
|
|
|
|
} |
1772
|
|
|
|
|
|
|
|
1773
|
4
|
|
|
|
|
10
|
return $output; |
1774
|
|
|
|
|
|
|
} |
1775
|
|
|
|
|
|
|
|
1776
|
|
|
|
|
|
|
sub text_for_attributes { |
1777
|
6
|
|
|
13
|
0
|
50
|
my ($self) = @_; |
1778
|
|
|
|
|
|
|
|
1779
|
6
|
|
|
|
|
47
|
my ($error, $result) = $self->catch('data', 'attributes'); |
1780
|
|
|
|
|
|
|
|
1781
|
6
|
|
|
|
|
35
|
my $output = []; |
1782
|
|
|
|
|
|
|
|
1783
|
6
|
50
|
|
|
|
266
|
if (!$error) { |
1784
|
4
|
|
|
|
|
29
|
push @$output, $result; |
1785
|
|
|
|
|
|
|
} |
1786
|
|
|
|
|
|
|
|
1787
|
6
|
|
|
|
|
22
|
return $output; |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
sub text_for_authors { |
1791
|
92
|
|
|
99
|
0
|
343
|
my ($self) = @_; |
1792
|
|
|
|
|
|
|
|
1793
|
92
|
|
|
|
|
766
|
my ($error, $result) = $self->catch('data', 'authors'); |
1794
|
|
|
|
|
|
|
|
1795
|
92
|
|
|
|
|
346
|
my $output = []; |
1796
|
|
|
|
|
|
|
|
1797
|
92
|
100
|
|
|
|
745
|
if (!$error) { |
1798
|
91
|
|
|
|
|
345
|
push @$output, $result; |
1799
|
|
|
|
|
|
|
} |
1800
|
|
|
|
|
|
|
|
1801
|
92
|
|
|
|
|
336
|
return $output; |
1802
|
|
|
|
|
|
|
} |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
sub text_for_description { |
1805
|
5
|
|
|
12
|
0
|
33
|
my ($self) = @_; |
1806
|
|
|
|
|
|
|
|
1807
|
5
|
|
|
|
|
36
|
my ($error, $result) = $self->catch('data', 'description'); |
1808
|
|
|
|
|
|
|
|
1809
|
5
|
|
|
|
|
20
|
my $output = []; |
1810
|
|
|
|
|
|
|
|
1811
|
5
|
50
|
|
|
|
266
|
if (!$error) { |
1812
|
5
|
|
|
|
|
36
|
push @$output, $result; |
1813
|
|
|
|
|
|
|
} |
1814
|
|
|
|
|
|
|
|
1815
|
5
|
|
|
|
|
12
|
return $output; |
1816
|
|
|
|
|
|
|
} |
1817
|
|
|
|
|
|
|
|
1818
|
|
|
|
|
|
|
sub text_for_encoding { |
1819
|
5
|
|
|
12
|
0
|
51
|
my ($self) = @_; |
1820
|
|
|
|
|
|
|
|
1821
|
5
|
|
|
|
|
37
|
my ($error, $result) = $self->catch('data', 'encoding'); |
1822
|
|
|
|
|
|
|
|
1823
|
5
|
|
|
|
|
17
|
my $output = []; |
1824
|
|
|
|
|
|
|
|
1825
|
5
|
50
|
|
|
|
154
|
if (!$error) { |
1826
|
4
|
|
|
|
|
28
|
push @$output, $result; |
1827
|
|
|
|
|
|
|
} |
1828
|
|
|
|
|
|
|
|
1829
|
5
|
|
|
|
|
16
|
return $output; |
1830
|
|
|
|
|
|
|
} |
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
sub text_for_error { |
1833
|
4
|
|
|
11
|
0
|
77
|
my ($self, $name) = @_; |
1834
|
|
|
|
|
|
|
|
1835
|
4
|
|
|
|
|
29
|
my ($error, $result) = $self->catch('data', 'error', $name); |
1836
|
|
|
|
|
|
|
|
1837
|
4
|
|
|
|
|
11
|
my $output = []; |
1838
|
|
|
|
|
|
|
|
1839
|
4
|
0
|
|
|
|
151
|
if (!$error) { |
1840
|
4
|
|
|
|
|
27
|
push @$output, $result; |
1841
|
|
|
|
|
|
|
} |
1842
|
|
|
|
|
|
|
|
1843
|
4
|
|
|
|
|
9
|
return $output; |
1844
|
|
|
|
|
|
|
} |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
sub text_for_example { |
1847
|
19
|
|
|
26
|
0
|
61
|
my ($self, $number, $name) = @_; |
1848
|
|
|
|
|
|
|
|
1849
|
19
|
|
|
|
|
59
|
my $output = []; |
1850
|
|
|
|
|
|
|
|
1851
|
19
|
|
|
|
|
76
|
my $data = $self->search({ |
1852
|
|
|
|
|
|
|
list => "example-$number", |
1853
|
|
|
|
|
|
|
name => $name, |
1854
|
|
|
|
|
|
|
}); |
1855
|
|
|
|
|
|
|
|
1856
|
19
|
50
|
|
|
|
254
|
push @$output, join "\n\n", @{$data->[0]{data}} if @$data; |
|
19
|
|
|
|
|
96
|
|
1857
|
|
|
|
|
|
|
|
1858
|
19
|
|
|
|
|
62
|
return $output; |
1859
|
|
|
|
|
|
|
} |
1860
|
|
|
|
|
|
|
|
1861
|
|
|
|
|
|
|
sub text_for_feature { |
1862
|
4
|
|
|
11
|
0
|
34
|
my ($self, $name) = @_; |
1863
|
|
|
|
|
|
|
|
1864
|
4
|
|
|
|
|
42
|
my ($error, $result) = $self->catch('data', 'feature', $name); |
1865
|
|
|
|
|
|
|
|
1866
|
4
|
|
|
|
|
10
|
my $output = []; |
1867
|
|
|
|
|
|
|
|
1868
|
4
|
0
|
|
|
|
143
|
if (!$error) { |
1869
|
4
|
|
|
|
|
58
|
push @$output, $result; |
1870
|
|
|
|
|
|
|
} |
1871
|
|
|
|
|
|
|
|
1872
|
4
|
|
|
|
|
11
|
return $output; |
1873
|
|
|
|
|
|
|
} |
1874
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
sub text_for_function { |
1876
|
5
|
|
|
12
|
0
|
84
|
my ($self, $name) = @_; |
1877
|
|
|
|
|
|
|
|
1878
|
5
|
|
|
|
|
31
|
my ($error, $result) = $self->catch('data', 'function', $name); |
1879
|
|
|
|
|
|
|
|
1880
|
5
|
|
|
|
|
14
|
my $output = []; |
1881
|
|
|
|
|
|
|
|
1882
|
5
|
50
|
|
|
|
160
|
if (!$error) { |
1883
|
5
|
|
|
|
|
29
|
push @$output, $result; |
1884
|
|
|
|
|
|
|
} |
1885
|
|
|
|
|
|
|
|
1886
|
5
|
|
|
|
|
16
|
return $output; |
1887
|
|
|
|
|
|
|
} |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
sub text_for_heading { |
1890
|
8
|
|
|
15
|
0
|
87
|
my ($self, $name) = @_; |
1891
|
|
|
|
|
|
|
|
1892
|
8
|
|
|
|
|
48
|
my ($error, $result) = $self->catch('data', 'heading', $name); |
1893
|
|
|
|
|
|
|
|
1894
|
8
|
|
|
|
|
23
|
my $output = []; |
1895
|
|
|
|
|
|
|
|
1896
|
8
|
50
|
|
|
|
124
|
if (!$error) { |
1897
|
4
|
|
|
|
|
28
|
push @$output, $result; |
1898
|
|
|
|
|
|
|
} |
1899
|
|
|
|
|
|
|
|
1900
|
8
|
|
|
|
|
27
|
return $output; |
1901
|
|
|
|
|
|
|
} |
1902
|
|
|
|
|
|
|
|
1903
|
|
|
|
|
|
|
sub text_for_include { |
1904
|
4
|
|
|
11
|
0
|
80
|
my ($self) = @_; |
1905
|
|
|
|
|
|
|
|
1906
|
4
|
|
|
|
|
32
|
my ($error, $result) = $self->catch('data', 'include'); |
1907
|
|
|
|
|
|
|
|
1908
|
4
|
|
|
|
|
11
|
my $output = []; |
1909
|
|
|
|
|
|
|
|
1910
|
4
|
0
|
|
|
|
127
|
if (!$error) { |
1911
|
4
|
|
|
|
|
28
|
push @$output, $result; |
1912
|
|
|
|
|
|
|
} |
1913
|
|
|
|
|
|
|
|
1914
|
4
|
|
|
|
|
13
|
return $output; |
1915
|
|
|
|
|
|
|
} |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
sub text_for_includes { |
1918
|
7
|
|
|
14
|
0
|
78
|
my ($self) = @_; |
1919
|
|
|
|
|
|
|
|
1920
|
7
|
|
|
|
|
59
|
my ($error, $result) = $self->catch('data', 'includes'); |
1921
|
|
|
|
|
|
|
|
1922
|
7
|
|
|
|
|
26
|
my $output = []; |
1923
|
|
|
|
|
|
|
|
1924
|
7
|
50
|
|
|
|
131
|
if (!$error) { |
1925
|
7
|
|
|
|
|
38
|
push @$output, $result; |
1926
|
|
|
|
|
|
|
} |
1927
|
|
|
|
|
|
|
|
1928
|
7
|
|
|
|
|
18
|
return $output; |
1929
|
|
|
|
|
|
|
} |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
sub text_for_inherits { |
1932
|
6
|
|
|
13
|
0
|
101
|
my ($self) = @_; |
1933
|
|
|
|
|
|
|
|
1934
|
6
|
|
|
|
|
34
|
my ($error, $result) = $self->catch('data', 'inherits'); |
1935
|
|
|
|
|
|
|
|
1936
|
6
|
|
|
|
|
31
|
my $output = []; |
1937
|
|
|
|
|
|
|
|
1938
|
6
|
50
|
|
|
|
127
|
if (!$error) { |
1939
|
6
|
|
|
|
|
33
|
push @$output, $result; |
1940
|
|
|
|
|
|
|
} |
1941
|
|
|
|
|
|
|
|
1942
|
6
|
|
|
|
|
16
|
return $output; |
1943
|
|
|
|
|
|
|
} |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
sub text_for_integrates { |
1946
|
6
|
|
|
13
|
0
|
86
|
my ($self) = @_; |
1947
|
|
|
|
|
|
|
|
1948
|
6
|
|
|
|
|
37
|
my ($error, $result) = $self->catch('data', 'integrates'); |
1949
|
|
|
|
|
|
|
|
1950
|
6
|
|
|
|
|
25
|
my $output = []; |
1951
|
|
|
|
|
|
|
|
1952
|
6
|
50
|
|
|
|
130
|
if (!$error) { |
1953
|
6
|
|
|
|
|
30
|
push @$output, $result; |
1954
|
|
|
|
|
|
|
} |
1955
|
|
|
|
|
|
|
|
1956
|
6
|
|
|
|
|
19
|
return $output; |
1957
|
|
|
|
|
|
|
} |
1958
|
|
|
|
|
|
|
|
1959
|
|
|
|
|
|
|
sub text_for_layout { |
1960
|
4
|
|
|
11
|
0
|
70
|
my ($self) = @_; |
1961
|
|
|
|
|
|
|
|
1962
|
4
|
|
|
|
|
28
|
my ($error, $result) = $self->catch('data', 'layout'); |
1963
|
|
|
|
|
|
|
|
1964
|
4
|
|
|
|
|
9
|
my $output = []; |
1965
|
|
|
|
|
|
|
|
1966
|
4
|
0
|
|
|
|
116
|
if (!$error) { |
1967
|
4
|
|
|
|
|
28
|
push @$output, $result; |
1968
|
|
|
|
|
|
|
} |
1969
|
|
|
|
|
|
|
|
1970
|
4
|
|
|
|
|
10
|
return $output; |
1971
|
|
|
|
|
|
|
} |
1972
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
sub text_for_libraries { |
1974
|
6
|
|
|
13
|
0
|
96
|
my ($self) = @_; |
1975
|
|
|
|
|
|
|
|
1976
|
6
|
|
|
|
|
40
|
my ($error, $result) = $self->catch('data', 'libraries'); |
1977
|
|
|
|
|
|
|
|
1978
|
6
|
|
|
|
|
18
|
my $output = []; |
1979
|
|
|
|
|
|
|
|
1980
|
6
|
50
|
|
|
|
159
|
if (!$error) { |
1981
|
4
|
|
|
|
|
29
|
push @$output, $result; |
1982
|
|
|
|
|
|
|
} |
1983
|
|
|
|
|
|
|
|
1984
|
6
|
|
|
|
|
21
|
return $output; |
1985
|
|
|
|
|
|
|
} |
1986
|
|
|
|
|
|
|
|
1987
|
|
|
|
|
|
|
sub text_for_license { |
1988
|
92
|
|
|
99
|
0
|
365
|
my ($self) = @_; |
1989
|
|
|
|
|
|
|
|
1990
|
91
|
|
|
|
|
805
|
my ($error, $result) = $self->catch('data', 'license'); |
1991
|
|
|
|
|
|
|
|
1992
|
91
|
|
|
|
|
362
|
my $output = []; |
1993
|
|
|
|
|
|
|
|
1994
|
91
|
100
|
|
|
|
496
|
if (!$error) { |
1995
|
90
|
|
|
|
|
316
|
push @$output, $result; |
1996
|
|
|
|
|
|
|
} |
1997
|
|
|
|
|
|
|
|
1998
|
91
|
|
|
|
|
342
|
return $output; |
1999
|
|
|
|
|
|
|
} |
2000
|
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
|
sub text_for_message { |
2002
|
3
|
|
|
11
|
0
|
99
|
my ($self, $name) = @_; |
2003
|
|
|
|
|
|
|
|
2004
|
3
|
|
|
|
|
26
|
my ($error, $result) = $self->catch('data', 'message', $name); |
2005
|
|
|
|
|
|
|
|
2006
|
3
|
|
|
|
|
7
|
my $output = []; |
2007
|
|
|
|
|
|
|
|
2008
|
3
|
0
|
|
|
|
78
|
if (!$error) { |
2009
|
3
|
|
|
|
|
20
|
push @$output, $result; |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
|
2012
|
3
|
|
|
|
|
7
|
return $output; |
2013
|
|
|
|
|
|
|
} |
2014
|
|
|
|
|
|
|
|
2015
|
|
|
|
|
|
|
sub text_for_metadata { |
2016
|
9
|
|
|
17
|
0
|
47
|
my ($self, $name) = @_; |
2017
|
|
|
|
|
|
|
|
2018
|
9
|
|
|
|
|
46
|
my ($error, $result) = $self->catch('data', 'metadata', $name); |
2019
|
|
|
|
|
|
|
|
2020
|
9
|
|
|
|
|
38
|
my $output = []; |
2021
|
|
|
|
|
|
|
|
2022
|
9
|
50
|
|
|
|
164
|
if (!$error) { |
2023
|
9
|
|
|
|
|
35
|
push @$output, $result; |
2024
|
|
|
|
|
|
|
} |
2025
|
|
|
|
|
|
|
|
2026
|
9
|
|
|
|
|
24
|
return $output; |
2027
|
|
|
|
|
|
|
} |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
sub text_for_method { |
2030
|
8
|
|
|
15
|
0
|
45
|
my ($self, $name) = @_; |
2031
|
|
|
|
|
|
|
|
2032
|
8
|
|
|
|
|
44
|
my ($error, $result) = $self->catch('data', 'method', $name); |
2033
|
|
|
|
|
|
|
|
2034
|
8
|
|
|
|
|
23
|
my $output = []; |
2035
|
|
|
|
|
|
|
|
2036
|
8
|
50
|
|
|
|
80
|
if (!$error) { |
2037
|
8
|
|
|
|
|
47
|
push @$output, $result; |
2038
|
|
|
|
|
|
|
} |
2039
|
|
|
|
|
|
|
|
2040
|
8
|
|
|
|
|
20
|
return $output; |
2041
|
|
|
|
|
|
|
} |
2042
|
|
|
|
|
|
|
|
2043
|
|
|
|
|
|
|
sub text_for_name { |
2044
|
7
|
|
|
14
|
0
|
106
|
my ($self) = @_; |
2045
|
|
|
|
|
|
|
|
2046
|
7
|
|
|
|
|
45
|
my ($error, $result) = $self->catch('data', 'name'); |
2047
|
|
|
|
|
|
|
|
2048
|
7
|
|
|
|
|
23
|
my $output = []; |
2049
|
|
|
|
|
|
|
|
2050
|
7
|
50
|
|
|
|
91
|
if (!$error) { |
2051
|
7
|
|
|
|
|
40
|
push @$output, $result; |
2052
|
|
|
|
|
|
|
} |
2053
|
|
|
|
|
|
|
|
2054
|
7
|
|
|
|
|
18
|
return $output; |
2055
|
|
|
|
|
|
|
} |
2056
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
sub text_for_operator { |
2058
|
3
|
|
|
10
|
0
|
63
|
my ($self, $name) = @_; |
2059
|
|
|
|
|
|
|
|
2060
|
2
|
|
|
|
|
19
|
my ($error, $result) = $self->catch('data', 'operator', $name); |
2061
|
|
|
|
|
|
|
|
2062
|
2
|
|
|
|
|
10
|
my $output = []; |
2063
|
|
|
|
|
|
|
|
2064
|
2
|
0
|
|
|
|
72
|
if (!$error) { |
2065
|
2
|
|
|
|
|
18
|
push @$output, $result; |
2066
|
|
|
|
|
|
|
} |
2067
|
|
|
|
|
|
|
|
2068
|
2
|
|
|
|
|
6
|
return $output; |
2069
|
|
|
|
|
|
|
} |
2070
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
sub text_for_partial { |
2072
|
4
|
|
|
12
|
0
|
29
|
my ($self, $text) = @_; |
2073
|
|
|
|
|
|
|
|
2074
|
4
|
|
|
|
|
22
|
my ($file, $method, @args) = @$text; |
2075
|
|
|
|
|
|
|
|
2076
|
4
|
|
|
|
|
27
|
my $test = $self->class->new($file); |
2077
|
|
|
|
|
|
|
|
2078
|
4
|
|
|
|
|
116
|
return [$test->$method(@args)]; |
2079
|
|
|
|
|
|
|
} |
2080
|
|
|
|
|
|
|
|
2081
|
|
|
|
|
|
|
sub text_for_partials { |
2082
|
3
|
|
|
11
|
0
|
568
|
my ($self) = @_; |
2083
|
|
|
|
|
|
|
|
2084
|
3
|
|
|
|
|
400
|
my ($error, $result) = $self->catch('data', 'partials'); |
2085
|
|
|
|
|
|
|
|
2086
|
3
|
|
|
|
|
27
|
my $output = []; |
2087
|
|
|
|
|
|
|
|
2088
|
3
|
50
|
|
|
|
20
|
if (!$error) { |
2089
|
|
|
|
|
|
|
push @$output, $self->text('partial', $_) |
2090
|
3
|
|
|
|
|
41
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $result; |
2091
|
|
|
|
|
|
|
} |
2092
|
|
|
|
|
|
|
|
2093
|
3
|
|
|
|
|
124
|
return $output; |
2094
|
|
|
|
|
|
|
} |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
sub text_for_project { |
2097
|
3
|
|
|
11
|
0
|
16
|
my ($self) = @_; |
2098
|
|
|
|
|
|
|
|
2099
|
3
|
|
|
|
|
10
|
my ($error, $result) = $self->catch('data', 'project'); |
2100
|
|
|
|
|
|
|
|
2101
|
3
|
|
|
|
|
26
|
my $output = []; |
2102
|
|
|
|
|
|
|
|
2103
|
3
|
50
|
|
|
|
24
|
if (!$error) { |
2104
|
2
|
|
|
|
|
4
|
push @$output, $result; |
2105
|
|
|
|
|
|
|
} |
2106
|
|
|
|
|
|
|
|
2107
|
3
|
|
|
|
|
97
|
return $output; |
2108
|
|
|
|
|
|
|
} |
2109
|
|
|
|
|
|
|
|
2110
|
|
|
|
|
|
|
sub text_for_signature { |
2111
|
8
|
|
|
16
|
0
|
33
|
my ($self, $name) = @_; |
2112
|
|
|
|
|
|
|
|
2113
|
8
|
|
|
|
|
31
|
my ($error, $result) = $self->catch('data', 'signature', $name); |
2114
|
|
|
|
|
|
|
|
2115
|
8
|
|
|
|
|
36
|
my $output = []; |
2116
|
|
|
|
|
|
|
|
2117
|
8
|
50
|
|
|
|
31
|
if (!$error) { |
2118
|
8
|
|
|
|
|
27
|
push @$output, $result; |
2119
|
|
|
|
|
|
|
} |
2120
|
|
|
|
|
|
|
|
2121
|
8
|
|
|
|
|
124
|
return $output; |
2122
|
|
|
|
|
|
|
} |
2123
|
|
|
|
|
|
|
|
2124
|
|
|
|
|
|
|
sub text_for_synopsis { |
2125
|
4
|
|
|
12
|
0
|
20
|
my ($self) = @_; |
2126
|
|
|
|
|
|
|
|
2127
|
4
|
|
|
|
|
15
|
my ($error, $result) = $self->catch('data', 'synopsis'); |
2128
|
|
|
|
|
|
|
|
2129
|
4
|
|
|
|
|
20
|
my $output = []; |
2130
|
|
|
|
|
|
|
|
2131
|
4
|
50
|
|
|
|
26
|
if (!$error) { |
2132
|
4
|
|
|
|
|
18
|
push @$output, $result; |
2133
|
|
|
|
|
|
|
} |
2134
|
|
|
|
|
|
|
|
2135
|
4
|
|
|
|
|
149
|
return $output; |
2136
|
|
|
|
|
|
|
} |
2137
|
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
|
sub text_for_tagline { |
2139
|
4
|
|
|
12
|
0
|
19
|
my ($self) = @_; |
2140
|
|
|
|
|
|
|
|
2141
|
4
|
|
|
|
|
14
|
my ($error, $result) = $self->catch('data', 'tagline'); |
2142
|
|
|
|
|
|
|
|
2143
|
4
|
|
|
|
|
35
|
my $output = []; |
2144
|
|
|
|
|
|
|
|
2145
|
4
|
50
|
|
|
|
28
|
if (!$error) { |
2146
|
4
|
|
|
|
|
14
|
push @$output, $result; |
2147
|
|
|
|
|
|
|
} |
2148
|
|
|
|
|
|
|
|
2149
|
4
|
|
|
|
|
117
|
return $output; |
2150
|
|
|
|
|
|
|
} |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
sub text_for_version { |
2153
|
3
|
|
|
11
|
0
|
19
|
my ($self) = @_; |
2154
|
|
|
|
|
|
|
|
2155
|
3
|
|
|
|
|
12
|
my ($error, $result) = $self->catch('data', 'version'); |
2156
|
|
|
|
|
|
|
|
2157
|
3
|
|
|
|
|
20
|
my $output = []; |
2158
|
|
|
|
|
|
|
|
2159
|
3
|
50
|
|
|
|
22
|
if (!$error) { |
2160
|
2
|
|
|
|
|
7
|
push @$output, $result; |
2161
|
|
|
|
|
|
|
} |
2162
|
|
|
|
|
|
|
|
2163
|
3
|
50
|
|
|
|
148
|
if (!@$output) { |
2164
|
3
|
|
|
|
|
28
|
my $name = $self->text_for_name; |
2165
|
3
|
50
|
|
|
|
34
|
if (my $version = ($name->[0] =~ m/([:\w]+)/m)[0]->VERSION) { |
2166
|
2
|
|
|
|
|
19
|
push @$output, $version; |
2167
|
|
|
|
|
|
|
} |
2168
|
|
|
|
|
|
|
} |
2169
|
|
|
|
|
|
|
|
2170
|
3
|
|
|
|
|
22
|
return $output; |
2171
|
|
|
|
|
|
|
} |
2172
|
|
|
|
|
|
|
|
2173
|
|
|
|
|
|
|
1; |
2174
|
|
|
|
|
|
|
|
2175
|
|
|
|
|
|
|
|
2176
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
=head1 NAME |
2178
|
|
|
|
|
|
|
|
2179
|
|
|
|
|
|
|
Venus::Test - Test Automation |
2180
|
|
|
|
|
|
|
|
2181
|
|
|
|
|
|
|
=cut |
2182
|
|
|
|
|
|
|
|
2183
|
|
|
|
|
|
|
=head1 ABSTRACT |
2184
|
|
|
|
|
|
|
|
2185
|
|
|
|
|
|
|
Test Automation for Perl 5 |
2186
|
|
|
|
|
|
|
|
2187
|
|
|
|
|
|
|
=cut |
2188
|
|
|
|
|
|
|
|
2189
|
|
|
|
|
|
|
=head1 SYNOPSIS |
2190
|
|
|
|
|
|
|
|
2191
|
|
|
|
|
|
|
package main; |
2192
|
|
|
|
|
|
|
|
2193
|
|
|
|
|
|
|
use Venus::Test; |
2194
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
my $test = test 't/Venus_Test.t'; |
2196
|
|
|
|
|
|
|
|
2197
|
|
|
|
|
|
|
# $test->for('name'); |
2198
|
|
|
|
|
|
|
|
2199
|
|
|
|
|
|
|
=cut |
2200
|
|
|
|
|
|
|
|
2201
|
|
|
|
|
|
|
=head1 DESCRIPTION |
2202
|
|
|
|
|
|
|
|
2203
|
|
|
|
|
|
|
This package aims to provide a standard for documenting L derived |
2204
|
|
|
|
|
|
|
software projects, a framework writing tests, test automation, and |
2205
|
|
|
|
|
|
|
documentation generation. |
2206
|
|
|
|
|
|
|
|
2207
|
|
|
|
|
|
|
=cut |
2208
|
|
|
|
|
|
|
|
2209
|
|
|
|
|
|
|
=head1 INHERITS |
2210
|
|
|
|
|
|
|
|
2211
|
|
|
|
|
|
|
This package inherits behaviors from: |
2212
|
|
|
|
|
|
|
|
2213
|
|
|
|
|
|
|
L |
2214
|
|
|
|
|
|
|
|
2215
|
|
|
|
|
|
|
=cut |
2216
|
|
|
|
|
|
|
|
2217
|
|
|
|
|
|
|
=head1 INTEGRATES |
2218
|
|
|
|
|
|
|
|
2219
|
|
|
|
|
|
|
This package integrates behaviors from: |
2220
|
|
|
|
|
|
|
|
2221
|
|
|
|
|
|
|
L |
2222
|
|
|
|
|
|
|
|
2223
|
|
|
|
|
|
|
L |
2224
|
|
|
|
|
|
|
|
2225
|
|
|
|
|
|
|
L |
2226
|
|
|
|
|
|
|
|
2227
|
|
|
|
|
|
|
L |
2228
|
|
|
|
|
|
|
|
2229
|
|
|
|
|
|
|
=cut |
2230
|
|
|
|
|
|
|
|
2231
|
|
|
|
|
|
|
=head1 FUNCTIONS |
2232
|
|
|
|
|
|
|
|
2233
|
|
|
|
|
|
|
This package provides the following functions: |
2234
|
|
|
|
|
|
|
|
2235
|
|
|
|
|
|
|
=cut |
2236
|
|
|
|
|
|
|
|
2237
|
|
|
|
|
|
|
=head2 test |
2238
|
|
|
|
|
|
|
|
2239
|
|
|
|
|
|
|
test(Str $file) (Test) |
2240
|
|
|
|
|
|
|
|
2241
|
|
|
|
|
|
|
The test function is exported automatically and returns a L object |
2242
|
|
|
|
|
|
|
for the test file given. |
2243
|
|
|
|
|
|
|
|
2244
|
|
|
|
|
|
|
I> |
2245
|
|
|
|
|
|
|
|
2246
|
|
|
|
|
|
|
=over 4 |
2247
|
|
|
|
|
|
|
|
2248
|
|
|
|
|
|
|
=item test example 1 |
2249
|
|
|
|
|
|
|
|
2250
|
|
|
|
|
|
|
package main; |
2251
|
|
|
|
|
|
|
|
2252
|
|
|
|
|
|
|
use Venus::Test; |
2253
|
|
|
|
|
|
|
|
2254
|
|
|
|
|
|
|
my $test = test 't/Venus_Test.t'; |
2255
|
|
|
|
|
|
|
|
2256
|
|
|
|
|
|
|
# bless( { ..., 'value' => 't/Venus_Test.t' }, 'Venus::Test' ) |
2257
|
|
|
|
|
|
|
|
2258
|
|
|
|
|
|
|
=back |
2259
|
|
|
|
|
|
|
|
2260
|
|
|
|
|
|
|
=cut |
2261
|
|
|
|
|
|
|
|
2262
|
|
|
|
|
|
|
=head1 METHODS |
2263
|
|
|
|
|
|
|
|
2264
|
|
|
|
|
|
|
This package provides the following methods: |
2265
|
|
|
|
|
|
|
|
2266
|
|
|
|
|
|
|
=cut |
2267
|
|
|
|
|
|
|
|
2268
|
|
|
|
|
|
|
=head2 data |
2269
|
|
|
|
|
|
|
|
2270
|
|
|
|
|
|
|
data(Str $name, Any @args) (Str) |
2271
|
|
|
|
|
|
|
|
2272
|
|
|
|
|
|
|
The data method attempts to find and return the POD content based on the name |
2273
|
|
|
|
|
|
|
provided. If the content cannot be found an exception is raised. |
2274
|
|
|
|
|
|
|
|
2275
|
|
|
|
|
|
|
I> |
2276
|
|
|
|
|
|
|
|
2277
|
|
|
|
|
|
|
=over 4 |
2278
|
|
|
|
|
|
|
|
2279
|
|
|
|
|
|
|
=item data example 1 |
2280
|
|
|
|
|
|
|
|
2281
|
|
|
|
|
|
|
# given: synopsis |
2282
|
|
|
|
|
|
|
|
2283
|
|
|
|
|
|
|
my $data = $test->data('name'); |
2284
|
|
|
|
|
|
|
|
2285
|
|
|
|
|
|
|
# Venus::Test |
2286
|
|
|
|
|
|
|
|
2287
|
|
|
|
|
|
|
=back |
2288
|
|
|
|
|
|
|
|
2289
|
|
|
|
|
|
|
=over 4 |
2290
|
|
|
|
|
|
|
|
2291
|
|
|
|
|
|
|
=item data example 2 |
2292
|
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
# given: synopsis |
2294
|
|
|
|
|
|
|
|
2295
|
|
|
|
|
|
|
my $data = $test->data('unknown'); |
2296
|
|
|
|
|
|
|
|
2297
|
|
|
|
|
|
|
# Exception! |
2298
|
|
|
|
|
|
|
|
2299
|
|
|
|
|
|
|
=back |
2300
|
|
|
|
|
|
|
|
2301
|
|
|
|
|
|
|
=cut |
2302
|
|
|
|
|
|
|
|
2303
|
|
|
|
|
|
|
=head2 for |
2304
|
|
|
|
|
|
|
|
2305
|
|
|
|
|
|
|
for(Str $name | CodeRef $code, Any @args) Any |
2306
|
|
|
|
|
|
|
|
2307
|
|
|
|
|
|
|
The for method attempts to find the POD content based on the name provided and |
2308
|
|
|
|
|
|
|
executes the corresponding predefined test, optionally accepting a callback |
2309
|
|
|
|
|
|
|
which, if provided, will be passes a L object containing the |
2310
|
|
|
|
|
|
|
POD-driven test. The callback, if provided, must always return a true value. |
2311
|
|
|
|
|
|
|
B All automated tests disable the I<"redefine"> class of warnings to |
2312
|
|
|
|
|
|
|
prevent warnings when redeclaring packages in examples. |
2313
|
|
|
|
|
|
|
|
2314
|
|
|
|
|
|
|
I> |
2315
|
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
=over 4 |
2317
|
|
|
|
|
|
|
|
2318
|
|
|
|
|
|
|
=item for example 1 |
2319
|
|
|
|
|
|
|
|
2320
|
|
|
|
|
|
|
# given: synopsis |
2321
|
|
|
|
|
|
|
|
2322
|
|
|
|
|
|
|
my $data = $test->for('name'); |
2323
|
|
|
|
|
|
|
|
2324
|
|
|
|
|
|
|
# Venus::Test |
2325
|
|
|
|
|
|
|
|
2326
|
|
|
|
|
|
|
=back |
2327
|
|
|
|
|
|
|
|
2328
|
|
|
|
|
|
|
=over 4 |
2329
|
|
|
|
|
|
|
|
2330
|
|
|
|
|
|
|
=item for example 2 |
2331
|
|
|
|
|
|
|
|
2332
|
|
|
|
|
|
|
# given: synopsis |
2333
|
|
|
|
|
|
|
|
2334
|
|
|
|
|
|
|
my $data = $test->for('synosis'); |
2335
|
|
|
|
|
|
|
|
2336
|
|
|
|
|
|
|
# true |
2337
|
|
|
|
|
|
|
|
2338
|
|
|
|
|
|
|
=back |
2339
|
|
|
|
|
|
|
|
2340
|
|
|
|
|
|
|
=over 4 |
2341
|
|
|
|
|
|
|
|
2342
|
|
|
|
|
|
|
=item for example 3 |
2343
|
|
|
|
|
|
|
|
2344
|
|
|
|
|
|
|
# given: synopsis |
2345
|
|
|
|
|
|
|
|
2346
|
|
|
|
|
|
|
my $data = $test->for('example', 1, 'data', sub { |
2347
|
|
|
|
|
|
|
my ($tryable) = @_; |
2348
|
|
|
|
|
|
|
my $result = $tryable->result; |
2349
|
|
|
|
|
|
|
ok length($result) > 1; |
2350
|
|
|
|
|
|
|
|
2351
|
|
|
|
|
|
|
$result |
2352
|
|
|
|
|
|
|
}); |
2353
|
|
|
|
|
|
|
|
2354
|
|
|
|
|
|
|
# Venus::Test |
2355
|
|
|
|
|
|
|
|
2356
|
|
|
|
|
|
|
=back |
2357
|
|
|
|
|
|
|
|
2358
|
|
|
|
|
|
|
=cut |
2359
|
|
|
|
|
|
|
|
2360
|
|
|
|
|
|
|
=head2 pdml |
2361
|
|
|
|
|
|
|
|
2362
|
|
|
|
|
|
|
pdml(Str $name | CodeRef $code, Any @args) Str |
2363
|
|
|
|
|
|
|
|
2364
|
|
|
|
|
|
|
The pdml method attempts to find the POD content based on the name provided and |
2365
|
|
|
|
|
|
|
return a POD string for use in documentation. |
2366
|
|
|
|
|
|
|
|
2367
|
|
|
|
|
|
|
I> |
2368
|
|
|
|
|
|
|
|
2369
|
|
|
|
|
|
|
=over 4 |
2370
|
|
|
|
|
|
|
|
2371
|
|
|
|
|
|
|
=item pdml example 1 |
2372
|
|
|
|
|
|
|
|
2373
|
|
|
|
|
|
|
# given: synopsis |
2374
|
|
|
|
|
|
|
|
2375
|
|
|
|
|
|
|
my $pdml = $test->pdml('name'); |
2376
|
|
|
|
|
|
|
|
2377
|
|
|
|
|
|
|
# =head1 NAME |
2378
|
|
|
|
|
|
|
# |
2379
|
|
|
|
|
|
|
# Venus::Test - Test Automation |
2380
|
|
|
|
|
|
|
# |
2381
|
|
|
|
|
|
|
# =cut |
2382
|
|
|
|
|
|
|
|
2383
|
|
|
|
|
|
|
=back |
2384
|
|
|
|
|
|
|
|
2385
|
|
|
|
|
|
|
=over 4 |
2386
|
|
|
|
|
|
|
|
2387
|
|
|
|
|
|
|
=item pdml example 2 |
2388
|
|
|
|
|
|
|
|
2389
|
|
|
|
|
|
|
# given: synopsis |
2390
|
|
|
|
|
|
|
|
2391
|
|
|
|
|
|
|
my $pdml = $test->pdml('synopsis'); |
2392
|
|
|
|
|
|
|
|
2393
|
|
|
|
|
|
|
# =head1 SYNOPSIS |
2394
|
|
|
|
|
|
|
# |
2395
|
|
|
|
|
|
|
# package main; |
2396
|
|
|
|
|
|
|
# |
2397
|
|
|
|
|
|
|
# use Venus::Test; |
2398
|
|
|
|
|
|
|
# |
2399
|
|
|
|
|
|
|
# my $test = test 't/Venus_Test.t'; |
2400
|
|
|
|
|
|
|
# |
2401
|
|
|
|
|
|
|
# # $test->for('name'); |
2402
|
|
|
|
|
|
|
# |
2403
|
|
|
|
|
|
|
# =cut |
2404
|
|
|
|
|
|
|
|
2405
|
|
|
|
|
|
|
=back |
2406
|
|
|
|
|
|
|
|
2407
|
|
|
|
|
|
|
=over 4 |
2408
|
|
|
|
|
|
|
|
2409
|
|
|
|
|
|
|
=item pdml example 3 |
2410
|
|
|
|
|
|
|
|
2411
|
|
|
|
|
|
|
# given: synopsis |
2412
|
|
|
|
|
|
|
|
2413
|
|
|
|
|
|
|
my $pdml = $test->pdml('example', 1, 'data'); |
2414
|
|
|
|
|
|
|
|
2415
|
|
|
|
|
|
|
# =over 4 |
2416
|
|
|
|
|
|
|
# |
2417
|
|
|
|
|
|
|
# =item data example 1 |
2418
|
|
|
|
|
|
|
# |
2419
|
|
|
|
|
|
|
# # given: synopsis |
2420
|
|
|
|
|
|
|
# |
2421
|
|
|
|
|
|
|
# my $data = $test->data(\'name\'); |
2422
|
|
|
|
|
|
|
# |
2423
|
|
|
|
|
|
|
# # Venus::Test |
2424
|
|
|
|
|
|
|
# |
2425
|
|
|
|
|
|
|
# =back |
2426
|
|
|
|
|
|
|
|
2427
|
|
|
|
|
|
|
=back |
2428
|
|
|
|
|
|
|
|
2429
|
|
|
|
|
|
|
=cut |
2430
|
|
|
|
|
|
|
|
2431
|
|
|
|
|
|
|
=head2 render |
2432
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
render(Str $file) Path |
2434
|
|
|
|
|
|
|
|
2435
|
|
|
|
|
|
|
The render method returns a string representation of a valid POD document. |
2436
|
|
|
|
|
|
|
|
2437
|
|
|
|
|
|
|
I> |
2438
|
|
|
|
|
|
|
|
2439
|
|
|
|
|
|
|
=over 4 |
2440
|
|
|
|
|
|
|
|
2441
|
|
|
|
|
|
|
=item render example 1 |
2442
|
|
|
|
|
|
|
|
2443
|
|
|
|
|
|
|
# given: synopsis |
2444
|
|
|
|
|
|
|
|
2445
|
|
|
|
|
|
|
my $path = $test->render('t/Test_Venus.pod'); |
2446
|
|
|
|
|
|
|
|
2447
|
|
|
|
|
|
|
# =over 4 |
2448
|
|
|
|
|
|
|
# |
2449
|
|
|
|
|
|
|
# =item data example 1 |
2450
|
|
|
|
|
|
|
# |
2451
|
|
|
|
|
|
|
# # given: synopsis |
2452
|
|
|
|
|
|
|
# |
2453
|
|
|
|
|
|
|
# my $data = $test->data(\'name\'); |
2454
|
|
|
|
|
|
|
# |
2455
|
|
|
|
|
|
|
# # Venus::Test |
2456
|
|
|
|
|
|
|
# |
2457
|
|
|
|
|
|
|
# =back |
2458
|
|
|
|
|
|
|
|
2459
|
|
|
|
|
|
|
=back |
2460
|
|
|
|
|
|
|
|
2461
|
|
|
|
|
|
|
=cut |
2462
|
|
|
|
|
|
|
|
2463
|
|
|
|
|
|
|
=head2 text |
2464
|
|
|
|
|
|
|
|
2465
|
|
|
|
|
|
|
text(Str $name, Any @args) (Str) |
2466
|
|
|
|
|
|
|
|
2467
|
|
|
|
|
|
|
The text method attempts to find and return the POD content based on the name |
2468
|
|
|
|
|
|
|
provided. If the content cannot be found an empty string is returned. If the |
2469
|
|
|
|
|
|
|
POD block is not recognized, an exception is raised. |
2470
|
|
|
|
|
|
|
|
2471
|
|
|
|
|
|
|
I> |
2472
|
|
|
|
|
|
|
|
2473
|
|
|
|
|
|
|
=over 4 |
2474
|
|
|
|
|
|
|
|
2475
|
|
|
|
|
|
|
=item text example 1 |
2476
|
|
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
# given: synopsis |
2478
|
|
|
|
|
|
|
|
2479
|
|
|
|
|
|
|
my $text = $test->text('name'); |
2480
|
|
|
|
|
|
|
|
2481
|
|
|
|
|
|
|
# Venus::Test |
2482
|
|
|
|
|
|
|
|
2483
|
|
|
|
|
|
|
=back |
2484
|
|
|
|
|
|
|
|
2485
|
|
|
|
|
|
|
=over 4 |
2486
|
|
|
|
|
|
|
|
2487
|
|
|
|
|
|
|
=item text example 2 |
2488
|
|
|
|
|
|
|
|
2489
|
|
|
|
|
|
|
# given: synopsis |
2490
|
|
|
|
|
|
|
|
2491
|
|
|
|
|
|
|
my $text = $test->text('includes'); |
2492
|
|
|
|
|
|
|
|
2493
|
|
|
|
|
|
|
# function: test |
2494
|
|
|
|
|
|
|
# method: data |
2495
|
|
|
|
|
|
|
# method: for |
2496
|
|
|
|
|
|
|
# method: pdml |
2497
|
|
|
|
|
|
|
# method: render |
2498
|
|
|
|
|
|
|
# method: text |
2499
|
|
|
|
|
|
|
|
2500
|
|
|
|
|
|
|
=back |
2501
|
|
|
|
|
|
|
|
2502
|
|
|
|
|
|
|
=over 4 |
2503
|
|
|
|
|
|
|
|
2504
|
|
|
|
|
|
|
=item text example 3 |
2505
|
|
|
|
|
|
|
|
2506
|
|
|
|
|
|
|
# given: synopsis |
2507
|
|
|
|
|
|
|
|
2508
|
|
|
|
|
|
|
my $text = $test->text('attributes'); |
2509
|
|
|
|
|
|
|
|
2510
|
|
|
|
|
|
|
# '' |
2511
|
|
|
|
|
|
|
|
2512
|
|
|
|
|
|
|
=back |
2513
|
|
|
|
|
|
|
|
2514
|
|
|
|
|
|
|
=over 4 |
2515
|
|
|
|
|
|
|
|
2516
|
|
|
|
|
|
|
=item text example 4 |
2517
|
|
|
|
|
|
|
|
2518
|
|
|
|
|
|
|
# given: synopsis |
2519
|
|
|
|
|
|
|
|
2520
|
|
|
|
|
|
|
my $text = $test->text('unknown'); |
2521
|
|
|
|
|
|
|
|
2522
|
|
|
|
|
|
|
# Exception! |
2523
|
|
|
|
|
|
|
|
2524
|
|
|
|
|
|
|
=back |
2525
|
|
|
|
|
|
|
|
2526
|
|
|
|
|
|
|
=cut |
2527
|
|
|
|
|
|
|
|
2528
|
|
|
|
|
|
|
=head1 AUTHORS |
2529
|
|
|
|
|
|
|
|
2530
|
|
|
|
|
|
|
Awncorp, C |
2531
|
|
|
|
|
|
|
|
2532
|
|
|
|
|
|
|
=cut |
2533
|
|
|
|
|
|
|
|
2534
|
|
|
|
|
|
|
=head1 LICENSE |
2535
|
|
|
|
|
|
|
|
2536
|
|
|
|
|
|
|
Copyright (C) 2000, Al Newkirk. |
2537
|
|
|
|
|
|
|
|
2538
|
|
|
|
|
|
|
This program is free software, you can redistribute it and/or modify it under |
2539
|
|
|
|
|
|
|
the terms of the Apache license version 2.0. |
2540
|
|
|
|
|
|
|
|
2541
|
|
|
|
|
|
|
=cut |