line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Venus::Test; |
2
|
|
|
|
|
|
|
|
3
|
132
|
|
|
132
|
|
5930739
|
use 5.018; |
|
130
|
|
|
|
|
1319
|
|
4
|
|
|
|
|
|
|
|
5
|
130
|
|
|
130
|
|
2679
|
use strict; |
|
130
|
|
|
|
|
466
|
|
|
129
|
|
|
|
|
2250
|
|
6
|
129
|
|
|
130
|
|
1177
|
use warnings; |
|
129
|
|
|
|
|
479
|
|
|
129
|
|
|
|
|
3059
|
|
7
|
|
|
|
|
|
|
|
8
|
129
|
|
|
130
|
|
39756
|
use Venus::Class 'attr', 'base', 'with'; |
|
129
|
|
|
|
|
521
|
|
|
129
|
|
|
|
|
634
|
|
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
|
|
1369
|
use Test::More (); |
|
129
|
|
|
|
|
551
|
|
|
129
|
|
|
|
|
2145
|
|
18
|
|
|
|
|
|
|
|
19
|
129
|
|
|
129
|
|
2160
|
use Exporter 'import'; |
|
129
|
|
|
|
|
465
|
|
|
129
|
|
|
|
|
1207034
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our @EXPORT = 'test'; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# EXPORTS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub test { |
26
|
125
|
|
|
125
|
1
|
9770
|
Venus::Test->new($_[0]); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# ATTRIBUTES |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
attr 'file'; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# BUILDERS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub build_arg { |
36
|
299
|
|
|
299
|
0
|
1262
|
my ($self, $data) = @_; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
return { |
39
|
299
|
|
|
|
|
1373
|
file => $data, |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub build_self { |
44
|
299
|
|
|
299
|
0
|
1995
|
my ($self, $data) = @_; |
45
|
|
|
|
|
|
|
|
46
|
299
|
|
|
|
|
1016
|
for my $item (qw(name abstract tagline synopsis description)) { |
47
|
1395
|
50
|
|
|
|
3094
|
$self->error("on.build_self.$item") if !@{$self->find(undef, $item)}; |
|
1395
|
|
|
|
|
5899
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
299
|
|
|
|
|
2234
|
return $self; |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub desc { |
56
|
197
|
|
|
197
|
0
|
728
|
my ($self, @args) = @_; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return join ' ', |
59
|
197
|
|
|
|
|
1427
|
map {s/^\s+|\s+$//gr} map {Test::More->can('explain')->($_)} @args; |
|
283
|
|
|
|
|
674324
|
|
|
283
|
|
|
|
|
3791
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub done { |
63
|
26
|
|
|
24
|
0
|
637
|
my ($self) = @_; |
64
|
|
|
|
|
|
|
|
65
|
24
|
|
|
|
|
181
|
return Test::More->can('done_testing')->(); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub dump { |
69
|
23
|
|
|
23
|
0
|
87
|
my ($self, @args) = @_; |
70
|
|
|
|
|
|
|
|
71
|
23
|
|
|
|
|
765
|
return Test::More->can('diag')->(Test::More->can('explain')->(@args)); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub encoding { |
75
|
23
|
|
|
23
|
0
|
180
|
my ($self, $name) = @_; |
76
|
|
|
|
|
|
|
|
77
|
23
|
|
|
|
|
72
|
return join("\n", "", "=encoding \U$name", "", "=cut"); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub error { |
81
|
38
|
|
|
38
|
0
|
661
|
my ($self, $name, $text, @args) = @_; |
82
|
|
|
|
|
|
|
|
83
|
38
|
|
|
|
|
212
|
my $throw; |
84
|
|
|
|
|
|
|
|
85
|
38
|
|
|
|
|
172
|
$throw = $self->throw; |
86
|
38
|
|
|
|
|
863
|
$throw->name($name); |
87
|
38
|
50
|
|
|
|
217
|
$throw->message($text) if $text; |
88
|
38
|
50
|
|
|
|
99
|
$throw->stash(@args) if @args; |
89
|
38
|
|
|
|
|
860
|
$throw->error; |
90
|
|
|
|
|
|
|
|
91
|
23
|
|
|
|
|
179
|
return; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub eval { |
95
|
2784
|
|
|
2784
|
0
|
6804
|
my ($self, $perl) = @_; |
96
|
|
|
|
|
|
|
|
97
|
2784
|
|
|
|
|
5168
|
local $@; |
98
|
|
|
|
|
|
|
|
99
|
128
|
100
|
66
|
128
|
|
1663
|
my @result = CORE::eval(join("\n\n", "no warnings q(redefine);", $perl)); |
|
128
|
100
|
33
|
128
|
|
572
|
|
|
128
|
50
|
0
|
122
|
|
5687
|
|
|
128
|
50
|
33
|
117
|
|
2368
|
|
|
128
|
100
|
|
110
|
|
518
|
|
|
128
|
100
|
|
106
|
|
1766
|
|
|
125
|
|
|
100
|
|
3071
|
|
|
122
|
|
|
99
|
|
3813
|
|
|
122
|
|
|
94
|
|
4578
|
|
|
117
|
|
|
94
|
|
1910
|
|
|
117
|
|
|
88
|
|
453
|
|
|
117
|
|
|
88
|
|
2350
|
|
|
111
|
|
|
88
|
|
2196
|
|
|
110
|
|
|
87
|
|
497
|
|
|
110
|
|
|
84
|
|
4496
|
|
|
106
|
|
|
84
|
|
1880
|
|
|
106
|
|
|
79
|
|
457
|
|
|
106
|
|
|
79
|
|
1619
|
|
|
102
|
|
|
77
|
|
1248
|
|
|
100
|
|
|
75
|
|
603
|
|
|
100
|
|
|
75
|
|
2981
|
|
|
99
|
|
|
75
|
|
1809
|
|
|
99
|
|
|
72
|
|
415
|
|
|
99
|
|
|
71
|
|
1444
|
|
|
96
|
|
|
71
|
|
1134
|
|
|
94
|
|
|
71
|
|
450
|
|
|
94
|
|
|
71
|
|
2759
|
|
|
94
|
|
|
70
|
|
1636
|
|
|
94
|
|
|
68
|
|
415
|
|
|
94
|
|
|
68
|
|
1394
|
|
|
90
|
|
|
577
|
|
1140
|
|
|
88
|
|
|
24
|
|
430
|
|
|
88
|
|
|
35
|
|
2657
|
|
|
88
|
|
|
45
|
|
1543
|
|
|
88
|
|
|
21
|
|
388
|
|
|
88
|
|
|
29
|
|
1144
|
|
|
88
|
|
|
63
|
|
1565
|
|
|
88
|
|
|
18
|
|
396
|
|
|
88
|
|
|
25
|
|
2753
|
|
|
88
|
|
|
11
|
|
2166
|
|
|
87
|
|
|
14
|
|
389
|
|
|
87
|
|
|
12
|
|
1180
|
|
|
85
|
|
|
12
|
|
1098
|
|
|
84
|
|
|
13
|
|
397
|
|
|
84
|
|
|
10
|
|
2403
|
|
|
84
|
|
|
13
|
|
1369
|
|
|
84
|
|
|
13
|
|
563
|
|
|
84
|
|
|
10
|
|
1058
|
|
|
80
|
|
|
10
|
|
2628
|
|
|
79
|
|
|
10
|
|
367
|
|
|
79
|
|
|
10
|
|
2320
|
|
|
79
|
|
|
10
|
|
1277
|
|
|
79
|
|
|
9
|
|
333
|
|
|
79
|
|
|
9
|
|
1106
|
|
|
78
|
|
|
9
|
|
1107
|
|
|
77
|
|
|
9
|
|
369
|
|
|
77
|
|
|
7
|
|
2149
|
|
|
77
|
|
|
7
|
|
1148
|
|
|
75
|
|
|
7
|
|
353
|
|
|
75
|
|
|
7
|
|
842
|
|
|
75
|
|
|
7
|
|
1517
|
|
|
75
|
|
|
7
|
|
374
|
|
|
75
|
|
|
7
|
|
2145
|
|
|
75
|
|
|
7
|
|
1657
|
|
|
75
|
|
|
7
|
|
320
|
|
|
75
|
|
|
7
|
|
964
|
|
|
73
|
|
|
7
|
|
1282
|
|
|
72
|
|
|
7
|
|
350
|
|
|
72
|
|
|
7
|
|
2208
|
|
|
71
|
|
|
7
|
|
1130
|
|
|
71
|
|
|
6
|
|
304
|
|
|
71
|
|
|
6
|
|
855
|
|
|
71
|
|
|
5
|
|
1722
|
|
|
71
|
|
|
5
|
|
339
|
|
|
71
|
|
|
5
|
|
2092
|
|
|
71
|
|
|
5
|
|
1837
|
|
|
71
|
|
|
5
|
|
308
|
|
|
71
|
|
|
5
|
|
959
|
|
|
71
|
|
|
5
|
|
988
|
|
|
71
|
|
|
5
|
|
761
|
|
|
71
|
|
|
5
|
|
1979
|
|
|
70
|
|
|
5
|
|
1085
|
|
|
70
|
|
|
5
|
|
328
|
|
|
70
|
|
|
5
|
|
988
|
|
|
68
|
|
|
5
|
|
935
|
|
|
68
|
|
|
5
|
|
304
|
|
|
68
|
|
|
5
|
|
1755
|
|
|
68
|
|
|
5
|
|
1067
|
|
|
68
|
|
|
5
|
|
286
|
|
|
68
|
|
|
5
|
|
607
|
|
|
2784
|
|
|
5
|
|
325024
|
|
|
568
|
|
|
5
|
|
2374
|
|
|
353
|
|
|
5
|
|
1337
|
|
|
23
|
|
|
5
|
|
112
|
|
|
12
|
|
|
5
|
|
45
|
|
|
30
|
|
|
5
|
|
193
|
|
|
26
|
|
|
5
|
|
109
|
|
|
12
|
|
|
5
|
|
123
|
|
|
38
|
|
|
5
|
|
279
|
|
|
35
|
|
|
5
|
|
129
|
|
|
11
|
|
|
5
|
|
48
|
|
|
11
|
|
|
5
|
|
66
|
|
|
31
|
|
|
5
|
|
155
|
|
|
11
|
|
|
5
|
|
53
|
|
|
41
|
|
|
5
|
|
333
|
|
|
19
|
|
|
5
|
|
120
|
|
|
7
|
|
|
5
|
|
29
|
|
|
6
|
|
|
5
|
|
43
|
|
|
7
|
|
|
5
|
|
71
|
|
|
16
|
|
|
5
|
|
125
|
|
|
6
|
|
|
5
|
|
134
|
|
|
3
|
|
|
5
|
|
18
|
|
|
6
|
|
|
4
|
|
18
|
|
|
6
|
|
|
4
|
|
66
|
|
|
4
|
|
|
4
|
|
31
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
53
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
52
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
4
|
|
|
1
|
|
|
4
|
|
43
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
51
|
|
|
1
|
|
|
4
|
|
5
|
|
|
1
|
|
|
4
|
|
2
|
|
|
1
|
|
|
4
|
|
7
|
|
|
1
|
|
|
4
|
|
11
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
44
|
|
|
1
|
|
|
4
|
|
6
|
|
|
1
|
|
|
4
|
|
3
|
|
|
1
|
|
|
4
|
|
8
|
|
|
1
|
|
|
3
|
|
8
|
|
|
1
|
|
|
3
|
|
2
|
|
|
1
|
|
|
3
|
|
46
|
|
|
1
|
|
|
3
|
|
7
|
|
|
1
|
|
|
3
|
|
3
|
|
|
1
|
|
|
3
|
|
7
|
|
|
1
|
|
|
3
|
|
8
|
|
|
1
|
|
|
3
|
|
2
|
|
|
1
|
|
|
3
|
|
46
|
|
|
1
|
|
|
3
|
|
6
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
2
|
|
9
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
42
|
|
|
1
|
|
|
2
|
|
5
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
8
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
44
|
|
|
1
|
|
|
2
|
|
5
|
|
|
1
|
|
|
2
|
|
2
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
43
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
7
|
|
|
1
|
|
|
2
|
|
3
|
|
|
1
|
|
|
2
|
|
43
|
|
|
1
|
|
|
2
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
43
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
52
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
43
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
42
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
42
|
|
|
1
|
|
|
1
|
|
5
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
21
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
52
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
9
|
|
|
1
|
|
|
1
|
|
3
|
|
|
1
|
|
|
1
|
|
62
|
|
|
1
|
|
|
1
|
|
6
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
8
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
1
|
|
7
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
51
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
66
|
|
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
100
|
|
|
|
|
|
|
|
101
|
2784
|
|
|
|
|
8007
|
my $dollarat = $@; |
102
|
|
|
|
|
|
|
|
103
|
2784
|
100
|
|
|
|
7929
|
die $dollarat if $dollarat; |
104
|
|
|
|
|
|
|
|
105
|
2706
|
50
|
|
|
|
15741
|
return wantarray ? (@result) : $result[0]; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub fail { |
109
|
24
|
|
|
24
|
0
|
73
|
my ($self, $data, $desc) = @_; |
110
|
|
|
|
|
|
|
|
111
|
24
|
|
33
|
|
|
819
|
return $self->proxy('ok', !!!$data, $desc) || $self->dump($data); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub find { |
115
|
3418
|
|
|
3418
|
0
|
10284
|
my ($self, @args) = @_; |
116
|
|
|
|
|
|
|
|
117
|
3418
|
|
|
|
|
9165
|
return $self->spec->find(@args); |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub for { |
121
|
3528
|
|
|
3528
|
1
|
54877
|
my ($self, $name, @args) = @_; |
122
|
|
|
|
|
|
|
|
123
|
3527
|
|
|
|
|
6199
|
my $result; |
124
|
|
|
|
|
|
|
|
125
|
3527
|
|
|
|
|
8380
|
my $method = "test_for_$name"; |
126
|
|
|
|
|
|
|
|
127
|
3527
|
50
|
|
|
|
20402
|
$self->error("on.for.$name") if !$self->can($method); |
128
|
|
|
|
|
|
|
|
129
|
11839
|
100
|
|
|
|
44588
|
$self->proxy('subtest', join(' ', map {ref($_) ? () : $_} $method, @args), sub { |
130
|
3527
|
|
|
3527
|
|
2844873
|
$result = $self->$method(@args); |
131
|
3527
|
|
|
|
|
9750
|
}); |
132
|
|
|
|
|
|
|
|
133
|
3527
|
|
|
|
|
4677217
|
return $result; |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub head1 { |
137
|
206
|
|
|
206
|
0
|
992
|
my ($self, $name, @data) = @_; |
138
|
|
|
|
|
|
|
|
139
|
206
|
|
|
|
|
3967
|
return join("\n", "", "=head1 \U$name", "", grep(defined, @data), "", "=cut"); |
140
|
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
sub head2 { |
143
|
28
|
|
|
28
|
0
|
174
|
my ($self, $name, @data) = @_; |
144
|
|
|
|
|
|
|
|
145
|
28
|
|
|
|
|
138
|
return join("\n", "", "=head2 \L$name", "", grep(defined, @data), "", "=cut"); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
sub item { |
149
|
37
|
|
|
37
|
1
|
468
|
my ($self, $name, $data) = @_; |
150
|
|
|
|
|
|
|
|
151
|
37
|
|
|
|
|
236
|
return ("=item $name\n", "$data\n"); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub like { |
155
|
43
|
|
|
43
|
0
|
13099
|
my ($self, $this, $that, $desc) = @_; |
156
|
|
|
|
|
|
|
|
157
|
43
|
50
|
|
|
|
1181
|
$that = qr/$that/ if ref $that ne 'Regexp'; |
158
|
|
|
|
|
|
|
|
159
|
42
|
|
|
|
|
218
|
return $self->proxy('like', $this, $that, $desc); |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub link { |
163
|
26
|
|
|
26
|
0
|
65
|
my ($self, @data) = @_; |
164
|
|
|
|
|
|
|
|
165
|
26
|
|
|
|
|
515
|
return ("L<@{[join('|', @data)]}>"); |
|
25
|
|
|
|
|
293
|
|
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub okay { |
169
|
22
|
|
|
22
|
0
|
92
|
my ($self, $data, $desc) = @_; |
170
|
|
|
|
|
|
|
|
171
|
22
|
|
|
|
|
1596
|
return $self->proxy('ok', !!$data, $desc); |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub over { |
175
|
35
|
|
|
35
|
0
|
327
|
my ($self, @data) = @_; |
176
|
|
|
|
|
|
|
|
177
|
35
|
|
|
|
|
151
|
return join("\n", "", "=over 4", "", grep(defined, @data), "=back"); |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub pass { |
181
|
7744
|
|
|
7744
|
0
|
21324
|
my ($self, $data, $desc) = @_; |
182
|
|
|
|
|
|
|
|
183
|
7744
|
|
33
|
|
|
23765
|
return $self->proxy('ok', !!$data, $desc) || $self->dump($data); |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub proxy { |
187
|
11276
|
|
|
11276
|
0
|
34733
|
my ($self, $name, @args) = @_; |
188
|
|
|
|
|
|
|
|
189
|
11276
|
|
|
|
|
18503
|
my $level = 1; |
190
|
11276
|
|
|
|
|
16805
|
my $regexp = qr{@{[quotemeta($self->file)]}$}; |
|
11276
|
|
|
|
|
32302
|
|
191
|
|
|
|
|
|
|
|
192
|
11276
|
|
|
|
|
100732
|
for (my $i = 0; my @caller = caller($i); $i++) { |
193
|
77790
|
100
|
|
|
|
114217
|
$level += $i; last if $caller[1] =~ $regexp; |
|
77790
|
|
|
|
|
512369
|
|
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
11276
|
|
|
|
|
28851
|
local $Test::Builder::Level = $Test::Builder::Level + $level; |
197
|
|
|
|
|
|
|
|
198
|
11276
|
|
|
|
|
64028
|
return Test::More->can($name)->(@args); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
sub render { |
202
|
21
|
|
|
21
|
1
|
60
|
my ($self, $file) = @_; |
203
|
|
|
|
|
|
|
|
204
|
21
|
|
|
|
|
357
|
require Venus::Path; |
205
|
|
|
|
|
|
|
|
206
|
21
|
|
|
|
|
163
|
my $path = Venus::Path->new($file); |
207
|
|
|
|
|
|
|
|
208
|
21
|
|
|
|
|
64
|
$path->parent->mkdirs; |
209
|
|
|
|
|
|
|
|
210
|
21
|
|
|
|
|
718
|
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
|
|
|
|
151
|
if (@{$self->find(undef, 'layout')}) { |
|
21
|
|
|
|
|
88
|
|
234
|
20
|
|
|
|
|
510
|
@layout = (split /\r?\n/, $self->text('layout')); |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
21
|
|
|
|
|
182
|
$path->write(join "\n", grep !!$_, map $self->show($_), @layout); |
238
|
|
|
|
|
|
|
|
239
|
21
|
|
|
|
|
84
|
return $path; |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
sub same { |
243
|
23
|
|
|
23
|
0
|
634
|
my ($self, $this, $that, $desc) = @_; |
244
|
|
|
|
|
|
|
|
245
|
23
|
|
|
|
|
185
|
return $self->proxy('is_deeply', $this, $that, $desc); |
246
|
|
|
|
|
|
|
} |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
sub search { |
249
|
3812
|
|
|
3812
|
0
|
8757
|
my ($self, @args) = @_; |
250
|
|
|
|
|
|
|
|
251
|
3812
|
|
|
|
|
10379
|
return $self->spec->search(@args); |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub show { |
255
|
40
|
|
|
40
|
0
|
201
|
my ($self, $spec) = @_; |
256
|
|
|
|
|
|
|
|
257
|
40
|
|
|
|
|
143
|
my ($name, $list) = split /:\s*/, $spec; |
258
|
|
|
|
|
|
|
|
259
|
40
|
|
|
|
|
674
|
my $method = "pdml_for_$name"; |
260
|
|
|
|
|
|
|
|
261
|
40
|
50
|
|
|
|
250
|
if ($self->can($method)) { |
262
|
40
|
|
|
|
|
118
|
return $self->pdml($name); |
263
|
|
|
|
|
|
|
} |
264
|
|
|
|
|
|
|
|
265
|
20
|
0
|
|
|
|
518
|
my $results = $self->search({$list ? (list => $list) : (name => $name)}); |
266
|
|
|
|
|
|
|
|
267
|
20
|
0
|
0
|
|
|
202
|
$self->error("on.show.$name") if !@$results && !grep $name eq $_, qw( |
268
|
|
|
|
|
|
|
messages |
269
|
|
|
|
|
|
|
); |
270
|
|
|
|
|
|
|
|
271
|
20
|
|
|
|
|
62
|
my @output; |
272
|
20
|
|
|
|
|
815
|
my $textual = 1; |
273
|
|
|
|
|
|
|
|
274
|
20
|
|
|
|
|
149
|
for my $result (@$results) { |
275
|
20
|
|
|
|
|
56
|
my @block; |
276
|
|
|
|
|
|
|
|
277
|
20
|
|
|
|
|
479
|
my $examples = 0; |
278
|
20
|
|
|
|
|
177
|
my $metadata = $self->text('metadata', $result->{name}); |
279
|
20
|
|
|
|
|
79
|
my $signature = $self->text('signature', $result->{name}); |
280
|
|
|
|
|
|
|
|
281
|
20
|
0
|
|
|
|
580
|
push @block, ($signature, '') if $signature; |
282
|
|
|
|
|
|
|
|
283
|
19
|
|
|
|
|
156
|
my $text = join "\n\n", @{$result->{data}}; |
|
19
|
|
|
|
|
62
|
|
284
|
|
|
|
|
|
|
|
285
|
19
|
0
|
|
|
|
424
|
if (!$text) { |
286
|
19
|
|
|
|
|
137
|
next; |
287
|
|
|
|
|
|
|
} |
288
|
|
|
|
|
|
|
else { |
289
|
19
|
|
|
|
|
57
|
push @block, $text; |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
|
292
|
19
|
0
|
|
|
|
552
|
if ($metadata) { |
293
|
19
|
|
|
|
|
135
|
local $@; |
294
|
19
|
0
|
|
|
|
68
|
if ($metadata = eval $metadata) { |
295
|
19
|
0
|
|
|
|
347
|
if (my $since = $metadata->{since}) { |
296
|
19
|
|
|
|
|
149
|
push @block, "", "I>"; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
} |
299
|
|
|
|
|
|
|
} |
300
|
|
|
|
|
|
|
|
301
|
19
|
|
|
|
|
93
|
my @results = $self->search({name => $result->{name}}); |
302
|
|
|
|
|
|
|
|
303
|
19
|
|
0
|
|
|
702
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
19
|
|
|
|
|
123
|
|
304
|
19
|
|
|
|
|
46
|
push @block, $self->pdml('example', $i, $result->{name}); |
305
|
19
|
|
|
|
|
344
|
$examples++; |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
19
|
0
|
0
|
|
|
143
|
if ($signature || $metadata || $examples) { |
|
|
|
0
|
|
|
|
|
309
|
19
|
|
|
|
|
77
|
push @output, ($self->head2($result->{name}, @block)); |
310
|
19
|
|
|
|
|
530
|
$textual = 0; |
311
|
|
|
|
|
|
|
} |
312
|
|
|
|
|
|
|
else { |
313
|
19
|
|
|
|
|
154
|
push @output, @block; |
314
|
|
|
|
|
|
|
} |
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
19
|
0
|
|
|
|
64
|
if (@output) { |
318
|
19
|
0
|
|
|
|
592
|
if ($textual) { |
319
|
19
|
|
|
|
|
147
|
@output = $self->head1($name, join "\n\n", @output); |
320
|
|
|
|
|
|
|
} |
321
|
|
|
|
|
|
|
else { |
322
|
19
|
0
|
0
|
|
|
49
|
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
|
|
|
|
|
555
|
return join "\n", @output; |
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
sub spec { |
334
|
7206
|
|
|
7207
|
0
|
13460
|
my ($self) = @_; |
335
|
|
|
|
|
|
|
|
336
|
7206
|
|
|
|
|
90338
|
require Venus::Data; |
337
|
|
|
|
|
|
|
|
338
|
7206
|
|
66
|
|
|
36269
|
$self->{data} ||= Venus::Data->new($self->file); |
339
|
|
|
|
|
|
|
|
340
|
7206
|
|
|
|
|
29066
|
return $self->{data}; |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub data { |
344
|
4888
|
|
|
4889
|
1
|
13107
|
my ($self, $name, @args) = @_; |
345
|
|
|
|
|
|
|
|
346
|
4888
|
|
|
|
|
12032
|
my $method = "data_for_$name"; |
347
|
|
|
|
|
|
|
|
348
|
4888
|
100
|
|
|
|
23111
|
$self->error("on.data.$name") if !$self->can($method); |
349
|
|
|
|
|
|
|
|
350
|
4887
|
100
|
|
|
|
20276
|
wantarray ? ($self->$method(@args)) : $self->$method(@args); |
351
|
|
|
|
|
|
|
} |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
sub data_for_abstract { |
354
|
106
|
|
|
107
|
0
|
629
|
my ($self) = @_; |
355
|
|
|
|
|
|
|
|
356
|
105
|
|
|
|
|
482
|
my $data = $self->find(undef, 'abstract'); |
357
|
|
|
|
|
|
|
|
358
|
105
|
50
|
|
|
|
650
|
$self->error('on.data.for.abstract') if !@$data; |
359
|
|
|
|
|
|
|
|
360
|
105
|
|
|
|
|
810
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
748
|
|
361
|
|
|
|
|
|
|
} |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
sub data_for_attribute { |
364
|
18
|
|
|
20
|
0
|
55
|
my ($self, $name) = @_; |
365
|
|
|
|
|
|
|
|
366
|
18
|
|
|
|
|
428
|
my $data = $self->search({ |
367
|
|
|
|
|
|
|
list => 'attribute', |
368
|
|
|
|
|
|
|
name => $name, |
369
|
|
|
|
|
|
|
}); |
370
|
|
|
|
|
|
|
|
371
|
18
|
0
|
|
|
|
125
|
$self->error('on.data.for.attribute') if !@$data; |
372
|
|
|
|
|
|
|
|
373
|
18
|
|
|
|
|
58
|
return join "\n\n", @{$data->[0]{data}}; |
|
18
|
|
|
|
|
451
|
|
374
|
|
|
|
|
|
|
} |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
sub data_for_attributes { |
377
|
35
|
|
|
37
|
0
|
203
|
my ($self) = @_; |
378
|
|
|
|
|
|
|
|
379
|
35
|
|
|
|
|
112
|
my $data = $self->find(undef, 'attributes'); |
380
|
|
|
|
|
|
|
|
381
|
35
|
100
|
|
|
|
501
|
$self->error('on.data.for.attributes') if !@$data; |
382
|
|
|
|
|
|
|
|
383
|
33
|
|
|
|
|
180
|
return join "\n\n", @{$data->[0]{data}}; |
|
33
|
|
|
|
|
193
|
|
384
|
|
|
|
|
|
|
} |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
sub data_for_authors { |
387
|
106
|
|
|
108
|
0
|
1524
|
my ($self) = @_; |
388
|
|
|
|
|
|
|
|
389
|
106
|
|
|
|
|
881
|
my $data = $self->find(undef, 'authors'); |
390
|
|
|
|
|
|
|
|
391
|
106
|
100
|
|
|
|
810
|
$self->error('on.data.for.authors') if !@$data; |
392
|
|
|
|
|
|
|
|
393
|
105
|
|
|
|
|
508
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
1239
|
|
394
|
|
|
|
|
|
|
} |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
sub data_for_description { |
397
|
105
|
|
|
107
|
0
|
364
|
my ($self) = @_; |
398
|
|
|
|
|
|
|
|
399
|
105
|
|
|
|
|
910
|
my $data = $self->find(undef, 'description'); |
400
|
|
|
|
|
|
|
|
401
|
105
|
50
|
|
|
|
761
|
$self->error('on.data.for.description') if !@$data; |
402
|
|
|
|
|
|
|
|
403
|
105
|
|
|
|
|
324
|
return join "\n\n", @{$data->[0]{data}}; |
|
105
|
|
|
|
|
1179
|
|
404
|
|
|
|
|
|
|
} |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
sub data_for_encoding { |
407
|
19
|
|
|
20
|
0
|
141
|
my ($self) = @_; |
408
|
|
|
|
|
|
|
|
409
|
19
|
|
|
|
|
60
|
my $data = $self->find(undef, 'encoding'); |
410
|
|
|
|
|
|
|
|
411
|
19
|
50
|
|
|
|
477
|
$self->error('on.data.for.encoding') if !@$data; |
412
|
|
|
|
|
|
|
|
413
|
18
|
|
|
|
|
125
|
return (map {map uc, split /\r?\n+/} @{$data->[0]{data}})[0]; |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
420
|
|
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
sub data_for_error { |
417
|
47
|
|
|
49
|
0
|
240
|
my ($self, $name) = @_; |
418
|
|
|
|
|
|
|
|
419
|
47
|
|
|
|
|
235
|
my $data = $self->search({ |
420
|
|
|
|
|
|
|
list => 'error', |
421
|
|
|
|
|
|
|
name => $name, |
422
|
|
|
|
|
|
|
}); |
423
|
|
|
|
|
|
|
|
424
|
47
|
50
|
|
|
|
739
|
$self->error('on.data.for.error') if !@$data; |
425
|
|
|
|
|
|
|
|
426
|
47
|
|
|
|
|
180
|
return join "\n\n", @{$data->[0]{data}}; |
|
47
|
|
|
|
|
297
|
|
427
|
|
|
|
|
|
|
} |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
sub data_for_example { |
430
|
2722
|
|
|
2724
|
0
|
6937
|
my ($self, $number, $name) = @_; |
431
|
|
|
|
|
|
|
|
432
|
2722
|
|
|
|
|
12838
|
my $data = $self->search({ |
433
|
|
|
|
|
|
|
list => "example-$number", |
434
|
|
|
|
|
|
|
name => $name, |
435
|
|
|
|
|
|
|
}); |
436
|
|
|
|
|
|
|
|
437
|
2722
|
50
|
|
|
|
13047
|
$self->error('on.data.for.example') if !@$data; |
438
|
|
|
|
|
|
|
|
439
|
2722
|
|
|
|
|
5630
|
return join "\n\n", @{$data->[0]{data}}; |
|
2722
|
|
|
|
|
21598
|
|
440
|
|
|
|
|
|
|
} |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
sub data_for_feature { |
443
|
32
|
|
|
34
|
0
|
89
|
my ($self, $name) = @_; |
444
|
|
|
|
|
|
|
|
445
|
32
|
|
|
|
|
384
|
my $data = $self->search({ |
446
|
|
|
|
|
|
|
list => 'feature', |
447
|
|
|
|
|
|
|
name => $name, |
448
|
|
|
|
|
|
|
}); |
449
|
|
|
|
|
|
|
|
450
|
31
|
50
|
|
|
|
198
|
$self->error('on.data.for.feature') if !@$data; |
451
|
|
|
|
|
|
|
|
452
|
31
|
|
|
|
|
68
|
return join "\n\n", @{$data->[0]{data}}; |
|
31
|
|
|
|
|
559
|
|
453
|
|
|
|
|
|
|
} |
454
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
sub data_for_function { |
456
|
17
|
|
|
20
|
0
|
121
|
my ($self, $name) = @_; |
457
|
|
|
|
|
|
|
|
458
|
17
|
|
|
|
|
48
|
my $data = $self->search({ |
459
|
|
|
|
|
|
|
list => 'function', |
460
|
|
|
|
|
|
|
name => $name, |
461
|
|
|
|
|
|
|
}); |
462
|
|
|
|
|
|
|
|
463
|
17
|
50
|
|
|
|
350
|
$self->error('on.data.for.function') if !@$data; |
464
|
|
|
|
|
|
|
|
465
|
17
|
|
|
|
|
117
|
return join "\n\n", @{$data->[0]{data}}; |
|
17
|
|
|
|
|
64
|
|
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub data_for_heading { |
469
|
20
|
|
|
23
|
0
|
478
|
my ($self, $name) = @_; |
470
|
|
|
|
|
|
|
|
471
|
20
|
|
|
|
|
120
|
my $data = $self->search({ |
472
|
|
|
|
|
|
|
list => 'heading', |
473
|
|
|
|
|
|
|
name => $name, |
474
|
|
|
|
|
|
|
}); |
475
|
|
|
|
|
|
|
|
476
|
20
|
50
|
|
|
|
74
|
$self->error('on.data.for.heading') if !@$data; |
477
|
|
|
|
|
|
|
|
478
|
16
|
|
|
|
|
330
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
117
|
|
479
|
|
|
|
|
|
|
} |
480
|
|
|
|
|
|
|
|
481
|
|
|
|
|
|
|
sub data_for_includes { |
482
|
99
|
|
|
103
|
0
|
365
|
my ($self) = @_; |
483
|
|
|
|
|
|
|
|
484
|
99
|
|
|
|
|
800
|
my $data = $self->find(undef, 'includes'); |
485
|
|
|
|
|
|
|
|
486
|
99
|
50
|
|
|
|
719
|
$self->error('on.data.for.includes') if !@$data; |
487
|
|
|
|
|
|
|
|
488
|
99
|
|
|
|
|
299
|
return join "\n\n", @{$data->[0]{data}}; |
|
99
|
|
|
|
|
910
|
|
489
|
|
|
|
|
|
|
} |
490
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
sub data_for_inherits { |
492
|
64
|
|
|
68
|
0
|
267
|
my ($self) = @_; |
493
|
|
|
|
|
|
|
|
494
|
64
|
|
|
|
|
213
|
my $data = $self->find(undef, 'inherits'); |
495
|
|
|
|
|
|
|
|
496
|
64
|
50
|
|
|
|
700
|
$self->error('on.data.for.inherits') if !@$data; |
497
|
|
|
|
|
|
|
|
498
|
64
|
|
|
|
|
267
|
return join "\n\n", @{$data->[0]{data}}; |
|
64
|
|
|
|
|
412
|
|
499
|
|
|
|
|
|
|
} |
500
|
|
|
|
|
|
|
|
501
|
|
|
|
|
|
|
sub data_for_integrates { |
502
|
43
|
|
|
47
|
0
|
469
|
my ($self) = @_; |
503
|
|
|
|
|
|
|
|
504
|
43
|
|
|
|
|
210
|
my $data = $self->find(undef, 'integrates'); |
505
|
|
|
|
|
|
|
|
506
|
43
|
50
|
|
|
|
224
|
$self->error('on.data.for.integrates') if !@$data; |
507
|
|
|
|
|
|
|
|
508
|
43
|
|
|
|
|
521
|
return join "\n\n", @{$data->[0]{data}}; |
|
43
|
|
|
|
|
318
|
|
509
|
|
|
|
|
|
|
} |
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
sub data_for_layout { |
512
|
15
|
|
|
19
|
0
|
45
|
my ($self) = @_; |
513
|
|
|
|
|
|
|
|
514
|
15
|
|
|
|
|
218
|
my $data = $self->find(undef, 'layout'); |
515
|
|
|
|
|
|
|
|
516
|
15
|
0
|
|
|
|
125
|
$self->error('on.data.for.layout') if !@$data; |
517
|
|
|
|
|
|
|
|
518
|
15
|
|
|
|
|
48
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
525
|
|
519
|
|
|
|
|
|
|
} |
520
|
|
|
|
|
|
|
|
521
|
|
|
|
|
|
|
sub data_for_libraries { |
522
|
17
|
|
|
21
|
0
|
107
|
my ($self) = @_; |
523
|
|
|
|
|
|
|
|
524
|
17
|
|
|
|
|
76
|
my $data = $self->find(undef, 'libraries'); |
525
|
|
|
|
|
|
|
|
526
|
17
|
50
|
|
|
|
219
|
$self->error('on.data.for.libraries') if !@$data; |
527
|
|
|
|
|
|
|
|
528
|
15
|
|
|
|
|
114
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
35
|
|
529
|
|
|
|
|
|
|
} |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
sub data_for_license { |
532
|
103
|
|
|
106
|
0
|
721
|
my ($self) = @_; |
533
|
|
|
|
|
|
|
|
534
|
103
|
|
|
|
|
508
|
my $data = $self->find(undef, 'license'); |
535
|
|
|
|
|
|
|
|
536
|
103
|
100
|
|
|
|
1012
|
$self->error('on.data.for.license') if !@$data; |
537
|
|
|
|
|
|
|
|
538
|
102
|
|
|
|
|
669
|
return join "\n\n", @{$data->[0]{data}}; |
|
102
|
|
|
|
|
1274
|
|
539
|
|
|
|
|
|
|
} |
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
sub data_for_message { |
542
|
15
|
|
|
18
|
0
|
41
|
my ($self, $name) = @_; |
543
|
|
|
|
|
|
|
|
544
|
15
|
|
|
|
|
443
|
my $data = $self->search({ |
545
|
|
|
|
|
|
|
list => 'message', |
546
|
|
|
|
|
|
|
name => $name, |
547
|
|
|
|
|
|
|
}); |
548
|
|
|
|
|
|
|
|
549
|
15
|
0
|
|
|
|
107
|
$self->error('on.data.for.message') if !@$data; |
550
|
|
|
|
|
|
|
|
551
|
15
|
|
|
|
|
34
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
245
|
|
552
|
|
|
|
|
|
|
} |
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
sub data_for_metadata { |
555
|
21
|
|
|
24
|
0
|
144
|
my ($self, $name) = @_; |
556
|
|
|
|
|
|
|
|
557
|
21
|
|
|
|
|
72
|
my $data = $self->search({ |
558
|
|
|
|
|
|
|
list => 'metadata', |
559
|
|
|
|
|
|
|
name => $name, |
560
|
|
|
|
|
|
|
}); |
561
|
|
|
|
|
|
|
|
562
|
21
|
50
|
|
|
|
561
|
$self->error('on.data.for.metadata') if !@$data; |
563
|
|
|
|
|
|
|
|
564
|
21
|
|
|
|
|
113
|
return join "\n\n", @{$data->[0]{data}}; |
|
21
|
|
|
|
|
86
|
|
565
|
|
|
|
|
|
|
} |
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
sub data_for_method { |
568
|
20
|
|
|
23
|
0
|
242
|
my ($self, $name) = @_; |
569
|
|
|
|
|
|
|
|
570
|
20
|
|
|
|
|
131
|
my $data = $self->search({ |
571
|
|
|
|
|
|
|
list => 'method', |
572
|
|
|
|
|
|
|
name => $name, |
573
|
|
|
|
|
|
|
}); |
574
|
|
|
|
|
|
|
|
575
|
20
|
50
|
|
|
|
68
|
$self->error('on.data.for.method') if !@$data; |
576
|
|
|
|
|
|
|
|
577
|
20
|
|
|
|
|
354
|
return join "\n\n", @{$data->[0]{data}}; |
|
20
|
|
|
|
|
161
|
|
578
|
|
|
|
|
|
|
} |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
sub data_for_name { |
581
|
195
|
|
|
198
|
0
|
537
|
my ($self) = @_; |
582
|
|
|
|
|
|
|
|
583
|
195
|
|
|
|
|
996
|
my $data = $self->find(undef, 'name'); |
584
|
|
|
|
|
|
|
|
585
|
195
|
50
|
|
|
|
1074
|
$self->error('on.data.for.name') if !@$data; |
586
|
|
|
|
|
|
|
|
587
|
195
|
|
|
|
|
472
|
return join "\n\n", @{$data->[0]{data}}; |
|
195
|
|
|
|
|
1712
|
|
588
|
|
|
|
|
|
|
} |
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
sub data_for_operator { |
591
|
87
|
|
|
90
|
0
|
335
|
my ($self, $name) = @_; |
592
|
|
|
|
|
|
|
|
593
|
87
|
|
|
|
|
386
|
my $data = $self->search({ |
594
|
|
|
|
|
|
|
list => 'operator', |
595
|
|
|
|
|
|
|
name => $name, |
596
|
|
|
|
|
|
|
}); |
597
|
|
|
|
|
|
|
|
598
|
87
|
50
|
|
|
|
758
|
$self->error('on.data.for.operator') if !@$data; |
599
|
|
|
|
|
|
|
|
600
|
87
|
|
|
|
|
293
|
return join "\n\n", @{$data->[0]{data}}; |
|
87
|
|
|
|
|
553
|
|
601
|
|
|
|
|
|
|
} |
602
|
|
|
|
|
|
|
|
603
|
|
|
|
|
|
|
sub data_for_partials { |
604
|
102
|
|
|
105
|
0
|
739
|
my ($self) = @_; |
605
|
|
|
|
|
|
|
|
606
|
102
|
|
|
|
|
479
|
my $data = $self->find(undef, 'partials'); |
607
|
|
|
|
|
|
|
|
608
|
102
|
50
|
|
|
|
681
|
$self->error('on.data.for.partials') if !@$data; |
609
|
|
|
|
|
|
|
|
610
|
102
|
|
|
|
|
611
|
return join "\n\n", @{$data->[0]{data}}; |
|
102
|
|
|
|
|
753
|
|
611
|
|
|
|
|
|
|
} |
612
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
sub data_for_project { |
614
|
16
|
|
|
19
|
0
|
41
|
my ($self) = @_; |
615
|
|
|
|
|
|
|
|
616
|
16
|
|
|
|
|
450
|
my $data = $self->find(undef, 'project'); |
617
|
|
|
|
|
|
|
|
618
|
16
|
50
|
|
|
|
117
|
$self->error('on.data.for.project') if !@$data; |
619
|
|
|
|
|
|
|
|
620
|
15
|
|
|
|
|
41
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
282
|
|
621
|
|
|
|
|
|
|
} |
622
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
sub data_for_signature { |
624
|
21
|
|
|
24
|
0
|
130
|
my ($self, $name) = @_; |
625
|
|
|
|
|
|
|
|
626
|
21
|
|
|
|
|
73
|
my $data = $self->search({ |
627
|
|
|
|
|
|
|
list => 'signature', |
628
|
|
|
|
|
|
|
name => $name, |
629
|
|
|
|
|
|
|
}); |
630
|
|
|
|
|
|
|
|
631
|
21
|
50
|
|
|
|
526
|
$self->error('on.data.for.signature') if !@$data; |
632
|
|
|
|
|
|
|
|
633
|
21
|
|
|
|
|
130
|
return join "\n\n", @{$data->[0]{data}}; |
|
21
|
|
|
|
|
108
|
|
634
|
|
|
|
|
|
|
} |
635
|
|
|
|
|
|
|
|
636
|
|
|
|
|
|
|
sub data_for_synopsis { |
637
|
1151
|
|
|
1154
|
0
|
3434
|
my ($self) = @_; |
638
|
|
|
|
|
|
|
|
639
|
1151
|
|
|
|
|
4297
|
my $data = $self->find(undef, 'synopsis'); |
640
|
|
|
|
|
|
|
|
641
|
1151
|
50
|
|
|
|
5750
|
$self->error('on.data.for.synopsis') if !@$data; |
642
|
|
|
|
|
|
|
|
643
|
1151
|
|
|
|
|
2957
|
return join "\n\n", @{$data->[0]{data}}; |
|
1151
|
|
|
|
|
9885
|
|
644
|
|
|
|
|
|
|
} |
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
sub data_for_tagline { |
647
|
103
|
|
|
105
|
0
|
403
|
my ($self) = @_; |
648
|
|
|
|
|
|
|
|
649
|
103
|
|
|
|
|
526
|
my $data = $self->find(undef, 'tagline'); |
650
|
|
|
|
|
|
|
|
651
|
103
|
50
|
|
|
|
743
|
$self->error('on.data.for.tagline') if !@$data; |
652
|
|
|
|
|
|
|
|
653
|
103
|
|
|
|
|
313
|
return join "\n\n", @{$data->[0]{data}}; |
|
103
|
|
|
|
|
1217
|
|
654
|
|
|
|
|
|
|
} |
655
|
|
|
|
|
|
|
|
656
|
|
|
|
|
|
|
sub data_for_version { |
657
|
16
|
|
|
18
|
0
|
144
|
my ($self) = @_; |
658
|
|
|
|
|
|
|
|
659
|
16
|
|
|
|
|
38
|
my $data = $self->find(undef, 'version'); |
660
|
|
|
|
|
|
|
|
661
|
16
|
50
|
|
|
|
309
|
$self->error('on.data.for.version') if !@$data; |
662
|
|
|
|
|
|
|
|
663
|
15
|
|
|
|
|
107
|
return join "\n\n", @{$data->[0]{data}}; |
|
15
|
|
|
|
|
51
|
|
664
|
|
|
|
|
|
|
} |
665
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
sub pdml { |
667
|
232
|
|
|
234
|
1
|
1828
|
my ($self, $name, @args) = @_; |
668
|
|
|
|
|
|
|
|
669
|
232
|
|
|
|
|
915
|
my $method = "pdml_for_$name"; |
670
|
|
|
|
|
|
|
|
671
|
232
|
50
|
|
|
|
1982
|
$self->error('on.pdml') if !$self->can($method); |
672
|
|
|
|
|
|
|
|
673
|
232
|
100
|
|
|
|
2143
|
wantarray ? ($self->$method(@args)) : $self->$method(@args); |
674
|
|
|
|
|
|
|
} |
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
sub pdml_for_abstract { |
677
|
16
|
|
|
18
|
0
|
117
|
my ($self) = @_; |
678
|
|
|
|
|
|
|
|
679
|
16
|
|
|
|
|
43
|
my $output; |
680
|
|
|
|
|
|
|
|
681
|
16
|
|
|
|
|
354
|
my $text = $self->text('abstract'); |
682
|
|
|
|
|
|
|
|
683
|
16
|
50
|
|
|
|
109
|
return $text ? ($self->head1('abstract', $text)) : (); |
684
|
|
|
|
|
|
|
} |
685
|
|
|
|
|
|
|
|
686
|
|
|
|
|
|
|
sub pdml_for_attribute_type1 { |
687
|
15
|
|
|
16
|
0
|
40
|
my ($self, $name, $is, $pre, $isa, $def) = @_; |
688
|
|
|
|
|
|
|
|
689
|
15
|
|
|
|
|
202
|
my @output; |
690
|
|
|
|
|
|
|
|
691
|
15
|
0
|
|
|
|
119
|
$is = $is eq 'ro' ? 'read-only' : 'read-write'; |
692
|
15
|
0
|
|
|
|
46
|
$pre = $pre eq 'req' ? 'required' : 'optional'; |
693
|
|
|
|
|
|
|
|
694
|
15
|
|
|
|
|
540
|
push @output, " $name($isa)\n"; |
695
|
15
|
0
|
|
|
|
105
|
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
|
|
|
|
|
47
|
return ($self->head2($name, @output)); |
700
|
|
|
|
|
|
|
} |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
sub pdml_for_attribute_type2 { |
703
|
15
|
|
|
16
|
0
|
263
|
my ($self, $name) = @_; |
704
|
|
|
|
|
|
|
|
705
|
15
|
|
|
|
|
111
|
my @output; |
706
|
|
|
|
|
|
|
|
707
|
15
|
|
|
|
|
50
|
my $metadata = $self->text('metadata', $name); |
708
|
15
|
|
|
|
|
378
|
my $signature = $self->text('signature', $name); |
709
|
|
|
|
|
|
|
|
710
|
15
|
0
|
|
|
|
102
|
push @output, ($signature, '') if $signature; |
711
|
|
|
|
|
|
|
|
712
|
15
|
|
|
|
|
36
|
my $text = $self->text('attribute', $name); |
713
|
|
|
|
|
|
|
|
714
|
15
|
0
|
|
|
|
431
|
return () if !$text; |
715
|
|
|
|
|
|
|
|
716
|
15
|
|
|
|
|
106
|
push @output, $text; |
717
|
|
|
|
|
|
|
|
718
|
15
|
0
|
|
|
|
50
|
if ($metadata) { |
719
|
15
|
|
|
|
|
380
|
local $@; |
720
|
15
|
0
|
|
|
|
100
|
if ($metadata = eval $metadata) { |
721
|
15
|
0
|
|
|
|
44
|
if (my $since = $metadata->{since}) { |
722
|
15
|
|
|
|
|
237
|
push @output, "", "I>"; |
723
|
|
|
|
|
|
|
} |
724
|
|
|
|
|
|
|
} |
725
|
|
|
|
|
|
|
} |
726
|
|
|
|
|
|
|
|
727
|
15
|
|
|
|
|
120
|
my @results = $self->search({name => $name}); |
728
|
|
|
|
|
|
|
|
729
|
15
|
|
0
|
|
|
37
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
15
|
|
|
|
|
565
|
|
730
|
15
|
|
|
|
|
104
|
push @output, $self->pdml('example', $i, $name), |
731
|
|
|
|
|
|
|
} |
732
|
|
|
|
|
|
|
|
733
|
15
|
|
|
|
|
44
|
return ($self->head2($name, @output)); |
734
|
|
|
|
|
|
|
} |
735
|
|
|
|
|
|
|
|
736
|
|
|
|
|
|
|
sub pdml_for_attributes { |
737
|
16
|
|
|
17
|
0
|
226
|
my ($self) = @_; |
738
|
|
|
|
|
|
|
|
739
|
16
|
50
|
|
|
|
108
|
my $method = $self->text('attributes') |
740
|
|
|
|
|
|
|
? 'pdml_for_attributes_type1' |
741
|
|
|
|
|
|
|
: 'pdml_for_attributes_type2'; |
742
|
|
|
|
|
|
|
|
743
|
16
|
|
|
|
|
58
|
return $self->$method; |
744
|
|
|
|
|
|
|
} |
745
|
|
|
|
|
|
|
|
746
|
|
|
|
|
|
|
sub pdml_for_attributes_type1 { |
747
|
15
|
|
|
16
|
0
|
432
|
my ($self) = @_; |
748
|
|
|
|
|
|
|
|
749
|
15
|
|
|
|
|
132
|
my @output; |
750
|
|
|
|
|
|
|
|
751
|
15
|
|
|
|
|
42
|
my $text = $self->text('attributes'); |
752
|
|
|
|
|
|
|
|
753
|
15
|
0
|
|
|
|
402
|
return () if !$text; |
754
|
|
|
|
|
|
|
|
755
|
15
|
|
|
|
|
102
|
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
|
|
|
|
|
427
|
|
758
|
|
|
|
|
|
|
)); |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
|
761
|
15
|
0
|
|
|
|
115
|
return () if !@output; |
762
|
|
|
|
|
|
|
|
763
|
15
|
0
|
|
|
|
41
|
if (@output) { |
764
|
15
|
|
0
|
|
|
316
|
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
|
|
|
|
|
140
|
return join "\n", @output; |
772
|
|
|
|
|
|
|
} |
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
sub pdml_for_attributes_type2 { |
775
|
16
|
|
|
16
|
0
|
55
|
my ($self) = @_; |
776
|
|
|
|
|
|
|
|
777
|
16
|
|
|
|
|
432
|
my @output; |
778
|
|
|
|
|
|
|
|
779
|
16
|
|
|
|
|
110
|
for my $list ($self->search({list => 'attribute'})) { |
780
|
15
|
|
|
|
|
46
|
push @output, $self->pdml('attribute_type2', $list->{name}); |
781
|
|
|
|
|
|
|
} |
782
|
|
|
|
|
|
|
|
783
|
16
|
50
|
|
|
|
310
|
if (@output) { |
784
|
15
|
|
0
|
|
|
109
|
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
|
|
|
|
|
44
|
return join "\n", @output; |
792
|
|
|
|
|
|
|
} |
793
|
|
|
|
|
|
|
|
794
|
|
|
|
|
|
|
sub pdml_for_authors { |
795
|
103
|
|
|
103
|
0
|
838
|
my ($self) = @_; |
796
|
|
|
|
|
|
|
|
797
|
103
|
|
|
|
|
326
|
my $output; |
798
|
|
|
|
|
|
|
|
799
|
103
|
|
|
|
|
652
|
my $text = $self->text('authors'); |
800
|
|
|
|
|
|
|
|
801
|
103
|
100
|
|
|
|
1355
|
return $text ? ($self->head1('authors', $text)) : (); |
802
|
|
|
|
|
|
|
} |
803
|
|
|
|
|
|
|
|
804
|
|
|
|
|
|
|
sub pdml_for_description { |
805
|
15
|
|
|
16
|
0
|
106
|
my ($self) = @_; |
806
|
|
|
|
|
|
|
|
807
|
15
|
|
|
|
|
41
|
my $output; |
808
|
|
|
|
|
|
|
|
809
|
15
|
|
|
|
|
290
|
my $text = $self->text('description'); |
810
|
|
|
|
|
|
|
|
811
|
15
|
50
|
|
|
|
103
|
return $text ? ($self->head1('description', $text)) : (); |
812
|
|
|
|
|
|
|
} |
813
|
|
|
|
|
|
|
|
814
|
|
|
|
|
|
|
sub pdml_for_encoding { |
815
|
15
|
|
|
16
|
0
|
46
|
my ($self) = @_; |
816
|
|
|
|
|
|
|
|
817
|
15
|
|
|
|
|
334
|
my $output; |
818
|
|
|
|
|
|
|
|
819
|
15
|
|
|
|
|
108
|
my $text = $self->text('encoding'); |
820
|
|
|
|
|
|
|
|
821
|
15
|
50
|
|
|
|
40
|
return $text ? ($self->encoding($text)) : (); |
822
|
|
|
|
|
|
|
} |
823
|
|
|
|
|
|
|
|
824
|
|
|
|
|
|
|
sub pdml_for_error { |
825
|
14
|
|
|
15
|
0
|
347
|
my ($self, $name) = @_; |
826
|
|
|
|
|
|
|
|
827
|
14
|
|
|
|
|
97
|
my @output; |
828
|
|
|
|
|
|
|
|
829
|
14
|
|
|
|
|
36
|
my $text = $self->text('error', $name); |
830
|
|
|
|
|
|
|
|
831
|
14
|
0
|
|
|
|
183
|
return () if !$text; |
832
|
|
|
|
|
|
|
|
833
|
13
|
|
|
|
|
94
|
my @results = $self->search({name => $name}); |
834
|
|
|
|
|
|
|
|
835
|
13
|
|
0
|
|
|
31
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
13
|
|
|
|
|
412
|
|
836
|
13
|
|
|
|
|
99
|
push @output, "B", $self->text('example', $i, $name); |
837
|
|
|
|
|
|
|
} |
838
|
|
|
|
|
|
|
|
839
|
13
|
|
|
|
|
36
|
return ($self->over($self->item("error: C<$name>", join "\n\n", $text, @output))); |
840
|
|
|
|
|
|
|
} |
841
|
|
|
|
|
|
|
|
842
|
|
|
|
|
|
|
sub pdml_for_errors { |
843
|
14
|
|
|
16
|
0
|
278
|
my ($self) = @_; |
844
|
|
|
|
|
|
|
|
845
|
14
|
|
|
|
|
92
|
my @output; |
846
|
|
|
|
|
|
|
|
847
|
14
|
|
|
|
|
42
|
for my $list ($self->search({list => 'error'})) { |
848
|
13
|
|
|
|
|
196
|
push @output, $self->pdml('error', $list->{name}); |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
|
851
|
14
|
50
|
|
|
|
99
|
if (@output) { |
852
|
13
|
|
0
|
|
|
31
|
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
|
|
|
|
|
333
|
return join "\n", @output; |
860
|
|
|
|
|
|
|
} |
861
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
sub pdml_for_example { |
863
|
28
|
|
|
30
|
0
|
130
|
my ($self, $number, $name) = @_; |
864
|
|
|
|
|
|
|
|
865
|
28
|
|
|
|
|
63
|
my @output; |
866
|
|
|
|
|
|
|
|
867
|
28
|
|
|
|
|
355
|
my $text = $self->text('example', $number, $name); |
868
|
|
|
|
|
|
|
|
869
|
28
|
50
|
|
|
|
167
|
return $text ? ($self->over($self->item("$name example $number", $text))) : (); |
870
|
|
|
|
|
|
|
} |
871
|
|
|
|
|
|
|
|
872
|
|
|
|
|
|
|
sub pdml_for_feature { |
873
|
13
|
|
|
15
|
0
|
45
|
my ($self, $name) = @_; |
874
|
|
|
|
|
|
|
|
875
|
13
|
|
|
|
|
167
|
my @output; |
876
|
|
|
|
|
|
|
|
877
|
13
|
|
|
|
|
131
|
my $signature = $self->text('signature', $name); |
878
|
|
|
|
|
|
|
|
879
|
13
|
0
|
|
|
|
51
|
push @output, ($signature, '') if $signature; |
880
|
|
|
|
|
|
|
|
881
|
13
|
|
|
|
|
416
|
my $text = $self->text('feature', $name); |
882
|
|
|
|
|
|
|
|
883
|
13
|
0
|
|
|
|
91
|
return () if !$text; |
884
|
|
|
|
|
|
|
|
885
|
13
|
|
|
|
|
36
|
my @results = $self->search({name => $name}); |
886
|
|
|
|
|
|
|
|
887
|
13
|
|
0
|
|
|
275
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
13
|
|
|
|
|
92
|
|
888
|
13
|
|
|
|
|
44
|
push @output, "B", $self->text('example', $i, $name); |
889
|
|
|
|
|
|
|
} |
890
|
|
|
|
|
|
|
|
891
|
13
|
|
|
|
|
255
|
return ($self->over($self->item($name, join "\n\n", $text, @output))); |
892
|
|
|
|
|
|
|
} |
893
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
sub pdml_for_features { |
895
|
13
|
|
|
16
|
0
|
82
|
my ($self) = @_; |
896
|
|
|
|
|
|
|
|
897
|
13
|
|
|
|
|
38
|
my @output; |
898
|
|
|
|
|
|
|
|
899
|
13
|
|
|
|
|
241
|
for my $list ($self->search({list => 'feature'})) { |
900
|
12
|
|
|
|
|
85
|
push @output, $self->pdml('feature', $list->{name}); |
901
|
|
|
|
|
|
|
} |
902
|
|
|
|
|
|
|
|
903
|
13
|
50
|
|
|
|
36
|
if (@output) { |
904
|
12
|
|
0
|
|
|
311
|
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
|
|
|
|
|
89
|
return join "\n", @output; |
912
|
|
|
|
|
|
|
} |
913
|
|
|
|
|
|
|
|
914
|
|
|
|
|
|
|
sub pdml_for_function { |
915
|
13
|
|
|
16
|
0
|
36
|
my ($self, $name) = @_; |
916
|
|
|
|
|
|
|
|
917
|
13
|
|
|
|
|
147
|
my @output; |
918
|
|
|
|
|
|
|
|
919
|
12
|
|
|
|
|
86
|
my $metadata = $self->text('metadata', $name); |
920
|
12
|
|
|
|
|
36
|
my $signature = $self->text('signature', $name); |
921
|
|
|
|
|
|
|
|
922
|
12
|
50
|
|
|
|
463
|
push @output, ($signature, '') if $signature; |
923
|
|
|
|
|
|
|
|
924
|
12
|
|
|
|
|
81
|
my $text = $self->text('function', $name); |
925
|
|
|
|
|
|
|
|
926
|
12
|
50
|
|
|
|
34
|
return () if !$text; |
927
|
|
|
|
|
|
|
|
928
|
12
|
|
|
|
|
184
|
push @output, $text; |
929
|
|
|
|
|
|
|
|
930
|
12
|
50
|
|
|
|
81
|
if ($metadata) { |
931
|
12
|
|
|
|
|
41
|
local $@; |
932
|
12
|
50
|
|
|
|
441
|
if ($metadata = eval $metadata) { |
933
|
12
|
50
|
|
|
|
77
|
if (my $since = $metadata->{since}) { |
934
|
12
|
|
|
|
|
39
|
push @output, "", "I>"; |
935
|
|
|
|
|
|
|
} |
936
|
|
|
|
|
|
|
} |
937
|
|
|
|
|
|
|
} |
938
|
|
|
|
|
|
|
|
939
|
12
|
|
|
|
|
261
|
my @results = $self->search({name => $name}); |
940
|
|
|
|
|
|
|
|
941
|
12
|
|
50
|
|
|
81
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
15
|
|
|
|
|
288
|
|
942
|
12
|
|
|
|
|
424
|
push @output, $self->pdml('example', $i, $name), |
943
|
|
|
|
|
|
|
} |
944
|
|
|
|
|
|
|
|
945
|
12
|
|
|
|
|
80
|
return ($self->head2($name, @output)); |
946
|
|
|
|
|
|
|
} |
947
|
|
|
|
|
|
|
|
948
|
|
|
|
|
|
|
sub pdml_for_functions { |
949
|
12
|
|
|
16
|
0
|
101
|
my ($self) = @_; |
950
|
|
|
|
|
|
|
|
951
|
12
|
|
|
|
|
205
|
my @output; |
952
|
|
|
|
|
|
|
|
953
|
12
|
|
|
|
|
94
|
my $type = 'function'; |
954
|
12
|
|
|
|
|
36
|
my $text = $self->text('includes'); |
955
|
|
|
|
|
|
|
|
956
|
12
|
|
|
|
|
480
|
for my $name (sort map /:\s*(\w+)$/, grep /^$type/, split /\r?\n/, $text) { |
957
|
12
|
|
|
|
|
91
|
push @output, $self->pdml($type, $name); |
958
|
|
|
|
|
|
|
} |
959
|
|
|
|
|
|
|
|
960
|
12
|
50
|
|
|
|
33
|
if (@output) { |
961
|
12
|
|
50
|
|
|
187
|
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
|
|
|
|
|
90
|
return join "\n", @output; |
969
|
|
|
|
|
|
|
} |
970
|
|
|
|
|
|
|
|
971
|
|
|
|
|
|
|
sub pdml_for_include { |
972
|
11
|
|
|
15
|
0
|
36
|
my ($self) = @_; |
973
|
|
|
|
|
|
|
|
974
|
11
|
|
|
|
|
324
|
my $output; |
975
|
|
|
|
|
|
|
|
976
|
11
|
|
|
|
|
72
|
my $text = $self->text('include'); |
977
|
|
|
|
|
|
|
|
978
|
11
|
|
|
|
|
36
|
return $output; |
979
|
|
|
|
|
|
|
} |
980
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
sub pdml_for_includes { |
982
|
11
|
|
|
15
|
0
|
213
|
my ($self) = @_; |
983
|
|
|
|
|
|
|
|
984
|
11
|
|
|
|
|
101
|
my $output; |
985
|
|
|
|
|
|
|
|
986
|
11
|
|
|
|
|
36
|
my $text = $self->text('includes'); |
987
|
|
|
|
|
|
|
|
988
|
11
|
|
|
|
|
303
|
return $output; |
989
|
|
|
|
|
|
|
} |
990
|
|
|
|
|
|
|
|
991
|
|
|
|
|
|
|
sub pdml_for_inherits { |
992
|
12
|
|
|
16
|
0
|
75
|
my ($self) = @_; |
993
|
|
|
|
|
|
|
|
994
|
12
|
|
|
|
|
41
|
my $text = $self->text('inherits'); |
995
|
|
|
|
|
|
|
|
996
|
12
|
|
|
|
|
211
|
my @output = map +($self->link($_), ""), grep defined, |
997
|
|
|
|
|
|
|
split /\r?\n/, $self->text('inherits'); |
998
|
|
|
|
|
|
|
|
999
|
12
|
50
|
|
|
|
93
|
return '' if !@output; |
1000
|
|
|
|
|
|
|
|
1001
|
12
|
|
|
|
|
37
|
pop @output; |
1002
|
|
|
|
|
|
|
|
1003
|
12
|
|
|
|
|
390
|
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
|
77
|
my ($self) = @_; |
1012
|
|
|
|
|
|
|
|
1013
|
12
|
|
|
|
|
31
|
my $text = $self->text('integrates'); |
1014
|
|
|
|
|
|
|
|
1015
|
12
|
|
|
|
|
143
|
my @output = map +($self->link($_), ""), grep defined, |
1016
|
|
|
|
|
|
|
split /\r?\n/, $self->text('integrates'); |
1017
|
|
|
|
|
|
|
|
1018
|
12
|
50
|
|
|
|
89
|
return '' if !@output; |
1019
|
|
|
|
|
|
|
|
1020
|
12
|
|
|
|
|
31
|
pop @output; |
1021
|
|
|
|
|
|
|
|
1022
|
12
|
|
|
|
|
351
|
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
|
89
|
my ($self) = @_; |
1031
|
|
|
|
|
|
|
|
1032
|
12
|
|
|
|
|
35
|
my $text = $self->text('libraries'); |
1033
|
|
|
|
|
|
|
|
1034
|
12
|
|
|
|
|
256
|
my @output = map +($self->link($_), ""), grep defined, |
1035
|
|
|
|
|
|
|
split /\r?\n/, $self->text('libraries'); |
1036
|
|
|
|
|
|
|
|
1037
|
12
|
50
|
|
|
|
100
|
return '' if !@output; |
1038
|
|
|
|
|
|
|
|
1039
|
11
|
|
|
|
|
35
|
pop @output; |
1040
|
|
|
|
|
|
|
|
1041
|
11
|
|
|
|
|
254
|
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
|
491
|
my ($self) = @_; |
1050
|
|
|
|
|
|
|
|
1051
|
99
|
|
|
|
|
297
|
my $output; |
1052
|
|
|
|
|
|
|
|
1053
|
99
|
|
|
|
|
796
|
my $text = $self->text('license'); |
1054
|
|
|
|
|
|
|
|
1055
|
99
|
100
|
|
|
|
1148
|
return $text ? ($self->head1('license', $text)) : (); |
1056
|
|
|
|
|
|
|
} |
1057
|
|
|
|
|
|
|
|
1058
|
|
|
|
|
|
|
sub pdml_for_message { |
1059
|
11
|
|
|
15
|
0
|
47
|
my ($self, $name) = @_; |
1060
|
|
|
|
|
|
|
|
1061
|
11
|
|
|
|
|
330
|
my @output; |
1062
|
|
|
|
|
|
|
|
1063
|
11
|
|
|
|
|
70
|
my $signature = $self->text('signature', $name); |
1064
|
|
|
|
|
|
|
|
1065
|
11
|
0
|
|
|
|
45
|
push @output, ($signature, '') if $signature; |
1066
|
|
|
|
|
|
|
|
1067
|
11
|
|
|
|
|
119
|
my $text = $self->text('message', $name); |
1068
|
|
|
|
|
|
|
|
1069
|
11
|
0
|
|
|
|
78
|
return () if !$text; |
1070
|
|
|
|
|
|
|
|
1071
|
11
|
|
|
|
|
40
|
my @results = $self->search({name => $name}); |
1072
|
|
|
|
|
|
|
|
1073
|
11
|
|
0
|
|
|
386
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
11
|
|
|
|
|
83
|
|
1074
|
11
|
|
|
|
|
34
|
push @output, "B", $self->text('example', $i, $name); |
1075
|
|
|
|
|
|
|
} |
1076
|
|
|
|
|
|
|
|
1077
|
11
|
|
|
|
|
223
|
return ($self->over($self->item($name, join "\n\n", $text, @output))); |
1078
|
|
|
|
|
|
|
} |
1079
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
sub pdml_for_messages { |
1081
|
12
|
|
|
16
|
0
|
86
|
my ($self) = @_; |
1082
|
|
|
|
|
|
|
|
1083
|
12
|
|
|
|
|
34
|
my @output; |
1084
|
|
|
|
|
|
|
|
1085
|
12
|
|
|
|
|
273
|
for my $list ($self->search({list => 'message'})) { |
1086
|
11
|
|
|
|
|
78
|
push @output, $self->pdml('message', $list->{name}); |
1087
|
|
|
|
|
|
|
} |
1088
|
|
|
|
|
|
|
|
1089
|
12
|
50
|
|
|
|
52
|
if (@output) { |
1090
|
11
|
|
0
|
|
|
271
|
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
|
|
|
|
|
94
|
return join "\n", @output; |
1098
|
|
|
|
|
|
|
} |
1099
|
|
|
|
|
|
|
|
1100
|
|
|
|
|
|
|
sub pdml_for_method { |
1101
|
16
|
|
|
20
|
0
|
58
|
my ($self, $name) = @_; |
1102
|
|
|
|
|
|
|
|
1103
|
16
|
|
|
|
|
304
|
my @output; |
1104
|
|
|
|
|
|
|
|
1105
|
16
|
|
|
|
|
97
|
my $metadata = $self->text('metadata', $name); |
1106
|
16
|
|
|
|
|
44
|
my $signature = $self->text('signature', $name); |
1107
|
|
|
|
|
|
|
|
1108
|
16
|
50
|
|
|
|
179
|
push @output, ($signature, '') if $signature; |
1109
|
|
|
|
|
|
|
|
1110
|
16
|
|
|
|
|
106
|
my $text = $self->text('method', $name); |
1111
|
|
|
|
|
|
|
|
1112
|
16
|
50
|
|
|
|
49
|
return () if !$text; |
1113
|
|
|
|
|
|
|
|
1114
|
16
|
|
|
|
|
372
|
push @output, $text; |
1115
|
|
|
|
|
|
|
|
1116
|
16
|
50
|
|
|
|
93
|
if ($metadata) { |
1117
|
16
|
|
|
|
|
32
|
local $@; |
1118
|
16
|
50
|
|
|
|
575
|
if ($metadata = eval $metadata) { |
1119
|
16
|
50
|
|
|
|
100
|
if (my $since = $metadata->{since}) { |
1120
|
16
|
|
|
|
|
49
|
push @output, "", "I>"; |
1121
|
|
|
|
|
|
|
} |
1122
|
|
|
|
|
|
|
} |
1123
|
|
|
|
|
|
|
} |
1124
|
|
|
|
|
|
|
|
1125
|
16
|
|
|
|
|
255
|
my @results = $self->search({name => $name}); |
1126
|
|
|
|
|
|
|
|
1127
|
16
|
|
50
|
|
|
106
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
39
|
|
|
|
|
132
|
|
1128
|
24
|
|
|
|
|
321
|
push @output, $self->pdml('example', $i, $name), |
1129
|
|
|
|
|
|
|
} |
1130
|
|
|
|
|
|
|
|
1131
|
16
|
|
|
|
|
89
|
return ($self->head2($name, @output)); |
1132
|
|
|
|
|
|
|
} |
1133
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
sub pdml_for_methods { |
1135
|
12
|
|
|
16
|
0
|
35
|
my ($self) = @_; |
1136
|
|
|
|
|
|
|
|
1137
|
12
|
|
|
|
|
248
|
my @output; |
1138
|
|
|
|
|
|
|
|
1139
|
12
|
|
|
|
|
87
|
my $type = 'method'; |
1140
|
12
|
|
|
|
|
41
|
my $text = $self->text('includes'); |
1141
|
|
|
|
|
|
|
|
1142
|
12
|
|
|
|
|
241
|
for my $name (sort map /:\s*(\w+)$/, grep /^$type/, split /\r?\n/, $text) { |
1143
|
16
|
|
|
|
|
98
|
push @output, $self->pdml($type, $name); |
1144
|
|
|
|
|
|
|
} |
1145
|
|
|
|
|
|
|
|
1146
|
12
|
50
|
|
|
|
50
|
if (@output) { |
1147
|
12
|
|
50
|
|
|
363
|
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
|
|
|
|
|
110
|
return join "\n", @output; |
1155
|
|
|
|
|
|
|
} |
1156
|
|
|
|
|
|
|
|
1157
|
|
|
|
|
|
|
sub pdml_for_name { |
1158
|
13
|
|
|
17
|
0
|
36
|
my ($self) = @_; |
1159
|
|
|
|
|
|
|
|
1160
|
13
|
|
|
|
|
208
|
my $output; |
1161
|
|
|
|
|
|
|
|
1162
|
12
|
|
|
|
|
79
|
my $name = join ' - ', map $self->text($_), 'name', 'tagline'; |
1163
|
|
|
|
|
|
|
|
1164
|
12
|
50
|
|
|
|
44
|
return $name ? ($self->head1('name', $name)) : (); |
1165
|
|
|
|
|
|
|
} |
1166
|
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
|
sub pdml_for_operator { |
1168
|
10
|
|
|
15
|
0
|
211
|
my ($self, $name) = @_; |
1169
|
|
|
|
|
|
|
|
1170
|
10
|
|
|
|
|
70
|
my @output; |
1171
|
|
|
|
|
|
|
|
1172
|
10
|
|
|
|
|
24
|
my $text = $self->text('operator', $name); |
1173
|
|
|
|
|
|
|
|
1174
|
10
|
0
|
|
|
|
210
|
return () if !$text; |
1175
|
|
|
|
|
|
|
|
1176
|
10
|
|
|
|
|
68
|
my @results = $self->search({name => $name}); |
1177
|
|
|
|
|
|
|
|
1178
|
10
|
|
0
|
|
|
30
|
for my $i (1..(int grep {($$_{list} || '') =~ /^example-\d+/} @results)) { |
|
10
|
|
|
|
|
225
|
|
1179
|
10
|
|
|
|
|
75
|
push @output, "B", $self->text('example', $i, $name); |
1180
|
|
|
|
|
|
|
} |
1181
|
|
|
|
|
|
|
|
1182
|
10
|
|
|
|
|
27
|
return ($self->over($self->item("operation: C<$name>", join "\n\n", $text, @output))); |
1183
|
|
|
|
|
|
|
} |
1184
|
|
|
|
|
|
|
|
1185
|
|
|
|
|
|
|
sub pdml_for_operators { |
1186
|
11
|
|
|
16
|
0
|
213
|
my ($self) = @_; |
1187
|
|
|
|
|
|
|
|
1188
|
11
|
|
|
|
|
71
|
my @output; |
1189
|
|
|
|
|
|
|
|
1190
|
11
|
|
|
|
|
36
|
for my $list ($self->search({list => 'operator'})) { |
1191
|
10
|
|
|
|
|
233
|
push @output, $self->pdml('operator', $list->{name}); |
1192
|
|
|
|
|
|
|
} |
1193
|
|
|
|
|
|
|
|
1194
|
11
|
50
|
|
|
|
93
|
if (@output) { |
1195
|
10
|
|
0
|
|
|
24
|
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
|
|
|
|
|
217
|
return join "\n", @output; |
1203
|
|
|
|
|
|
|
} |
1204
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
sub pdml_for_partials { |
1206
|
11
|
|
|
16
|
0
|
85
|
my ($self) = @_; |
1207
|
|
|
|
|
|
|
|
1208
|
11
|
|
|
|
|
29
|
my $output; |
1209
|
|
|
|
|
|
|
|
1210
|
11
|
|
|
|
|
291
|
my $text = $self->text('partials'); |
1211
|
|
|
|
|
|
|
|
1212
|
11
|
50
|
|
|
|
141
|
return $text ? ($text) : (); |
1213
|
|
|
|
|
|
|
} |
1214
|
|
|
|
|
|
|
|
1215
|
|
|
|
|
|
|
sub pdml_for_project { |
1216
|
11
|
|
|
16
|
0
|
29
|
my ($self) = @_; |
1217
|
|
|
|
|
|
|
|
1218
|
11
|
|
|
|
|
224
|
my $output; |
1219
|
|
|
|
|
|
|
|
1220
|
11
|
|
|
|
|
76
|
my $text = $self->text('project'); |
1221
|
|
|
|
|
|
|
|
1222
|
11
|
50
|
|
|
|
63
|
return $text ? ($self->head1('project', $text)) : (); |
1223
|
|
|
|
|
|
|
} |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
sub pdml_for_synopsis { |
1226
|
12
|
|
|
17
|
0
|
313
|
my ($self) = @_; |
1227
|
|
|
|
|
|
|
|
1228
|
12
|
|
|
|
|
68
|
my $output; |
1229
|
|
|
|
|
|
|
|
1230
|
12
|
|
|
|
|
37
|
my $text = $self->text('synopsis'); |
1231
|
|
|
|
|
|
|
|
1232
|
12
|
50
|
|
|
|
151
|
return $text ? ($self->head1('synopsis', $text)) : (); |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
|
1235
|
|
|
|
|
|
|
sub pdml_for_tagline { |
1236
|
10
|
|
|
15
|
0
|
89
|
my ($self) = @_; |
1237
|
|
|
|
|
|
|
|
1238
|
10
|
|
|
|
|
29
|
my $output; |
1239
|
|
|
|
|
|
|
|
1240
|
10
|
|
|
|
|
319
|
my $text = $self->text('tagline'); |
1241
|
|
|
|
|
|
|
|
1242
|
10
|
0
|
|
|
|
61
|
return $text ? ($self->head1('tagline', $text)) : (); |
1243
|
|
|
|
|
|
|
} |
1244
|
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
|
sub pdml_for_version { |
1246
|
11
|
|
|
16
|
0
|
31
|
my ($self) = @_; |
1247
|
|
|
|
|
|
|
|
1248
|
11
|
|
|
|
|
240
|
my $output; |
1249
|
|
|
|
|
|
|
|
1250
|
11
|
|
|
|
|
79
|
my $text = $self->text('version'); |
1251
|
|
|
|
|
|
|
|
1252
|
11
|
50
|
|
|
|
45
|
return $text ? ($self->head1('version', $text)) : (); |
1253
|
|
|
|
|
|
|
} |
1254
|
|
|
|
|
|
|
|
1255
|
|
|
|
|
|
|
sub test_for_abstract { |
1256
|
96
|
|
|
101
|
0
|
693
|
my ($self, $code) = @_; |
1257
|
|
|
|
|
|
|
|
1258
|
96
|
|
|
|
|
436
|
my $data = $self->data('abstract'); |
1259
|
|
|
|
|
|
|
|
1260
|
|
|
|
|
|
|
$code ||= sub { |
1261
|
96
|
|
|
101
|
|
618
|
length($data) > 1; |
1262
|
96
|
|
50
|
|
|
1356
|
}; |
1263
|
|
|
|
|
|
|
|
1264
|
96
|
|
|
|
|
398
|
my $result = $code->(); |
1265
|
|
|
|
|
|
|
|
1266
|
96
|
|
|
|
|
447
|
$self->pass($result, '=abstract'); |
1267
|
|
|
|
|
|
|
|
1268
|
96
|
|
|
|
|
38405
|
return $result; |
1269
|
|
|
|
|
|
|
} |
1270
|
|
|
|
|
|
|
|
1271
|
|
|
|
|
|
|
sub test_for_attribute { |
1272
|
10
|
|
|
15
|
0
|
69
|
my ($self, $name, $code) = @_; |
1273
|
|
|
|
|
|
|
|
1274
|
10
|
|
|
|
|
32
|
my $data = $self->data('attribute', $name); |
1275
|
|
|
|
|
|
|
|
1276
|
|
|
|
|
|
|
$code ||= sub { |
1277
|
10
|
|
|
15
|
|
88
|
length($data) > 1; |
1278
|
10
|
|
0
|
|
|
143
|
}; |
1279
|
|
|
|
|
|
|
|
1280
|
10
|
|
|
|
|
33
|
my $result = $code->(); |
1281
|
|
|
|
|
|
|
|
1282
|
10
|
|
|
|
|
325
|
$self->pass($result, "=attribute $name"); |
1283
|
|
|
|
|
|
|
|
1284
|
10
|
|
|
|
|
65
|
my $package = $self->data('name'); |
1285
|
|
|
|
|
|
|
|
1286
|
10
|
|
|
|
|
28
|
$self->pass($package->can($name), "$package has $name"); |
1287
|
|
|
|
|
|
|
|
1288
|
10
|
|
|
|
|
141
|
return $result; |
1289
|
|
|
|
|
|
|
} |
1290
|
|
|
|
|
|
|
|
1291
|
|
|
|
|
|
|
sub test_for_attributes { |
1292
|
25
|
|
|
30
|
0
|
219
|
my ($self, $code) = @_; |
1293
|
|
|
|
|
|
|
|
1294
|
25
|
|
|
|
|
92
|
my $data = $self->data('attributes'); |
1295
|
25
|
|
|
|
|
312
|
my $package = $self->data('name'); |
1296
|
|
|
|
|
|
|
|
1297
|
|
|
|
|
|
|
$code ||= sub { |
1298
|
25
|
|
|
30
|
|
178
|
for my $line (split /\r?\n/, $data) { |
1299
|
61
|
|
|
|
|
15558
|
my ($name, $is, $pre, $isa, $def) = map { split /,\s*/ } split /:\s*/, |
|
112
|
|
|
|
|
556
|
|
1300
|
|
|
|
|
|
|
$line, 2; |
1301
|
61
|
|
|
|
|
549
|
$self->pass($package->can($name), "$package has $name"); |
1302
|
61
|
|
33
|
|
|
22254
|
$self->pass((($is eq 'ro' || $is eq 'rw') |
1303
|
|
|
|
|
|
|
&& ($pre eq 'opt' || $pre eq 'req') |
1304
|
|
|
|
|
|
|
&& $isa), $line); |
1305
|
|
|
|
|
|
|
} |
1306
|
|
|
|
|
|
|
$data |
1307
|
25
|
|
50
|
|
|
296
|
}; |
|
25
|
|
|
|
|
6168
|
|
1308
|
|
|
|
|
|
|
|
1309
|
25
|
|
|
|
|
127
|
my $result = $code->(); |
1310
|
|
|
|
|
|
|
|
1311
|
25
|
|
|
|
|
342
|
$self->pass($result, "=attributes"); |
1312
|
|
|
|
|
|
|
|
1313
|
25
|
|
|
|
|
6079
|
return $result; |
1314
|
|
|
|
|
|
|
} |
1315
|
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
|
sub test_for_authors { |
1317
|
10
|
|
|
15
|
0
|
26
|
my ($self, $code) = @_; |
1318
|
|
|
|
|
|
|
|
1319
|
10
|
|
|
|
|
288
|
my $data = $self->data('authors'); |
1320
|
|
|
|
|
|
|
|
1321
|
|
|
|
|
|
|
$code ||= sub { |
1322
|
10
|
|
|
15
|
|
20
|
length($data) > 1; |
1323
|
10
|
|
0
|
|
|
74
|
}; |
1324
|
|
|
|
|
|
|
|
1325
|
10
|
|
|
|
|
113
|
my $result = $code->(); |
1326
|
|
|
|
|
|
|
|
1327
|
10
|
|
|
|
|
81
|
$self->pass($result, '=authors'); |
1328
|
|
|
|
|
|
|
|
1329
|
10
|
|
|
|
|
24
|
return $result; |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
sub test_for_description { |
1333
|
96
|
|
|
101
|
0
|
860
|
my ($self, $code) = @_; |
1334
|
|
|
|
|
|
|
|
1335
|
96
|
|
|
|
|
453
|
my $data = $self->data('description'); |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
$code ||= sub { |
1338
|
96
|
|
|
101
|
|
527
|
length($data) > 1; |
1339
|
96
|
|
50
|
|
|
990
|
}; |
1340
|
|
|
|
|
|
|
|
1341
|
96
|
|
|
|
|
431
|
my $result = $code->(); |
1342
|
|
|
|
|
|
|
|
1343
|
96
|
|
|
|
|
444
|
$self->pass($result, '=description'); |
1344
|
|
|
|
|
|
|
|
1345
|
96
|
|
|
|
|
38839
|
return $result; |
1346
|
|
|
|
|
|
|
} |
1347
|
|
|
|
|
|
|
|
1348
|
|
|
|
|
|
|
sub test_for_encoding { |
1349
|
10
|
|
|
15
|
0
|
75
|
my ($self, $name, $code) = @_; |
1350
|
|
|
|
|
|
|
|
1351
|
10
|
|
|
|
|
26
|
my $data = $self->data('encoding'); |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
$code ||= sub { |
1354
|
10
|
|
|
15
|
|
69
|
length($data) > 1; |
1355
|
10
|
|
0
|
|
|
218
|
}; |
1356
|
|
|
|
|
|
|
|
1357
|
10
|
|
|
|
|
29
|
my $result = $code->(); |
1358
|
|
|
|
|
|
|
|
1359
|
10
|
|
|
|
|
231
|
$self->pass($result, "=encoding"); |
1360
|
|
|
|
|
|
|
|
1361
|
10
|
|
|
|
|
68
|
return $result; |
1362
|
|
|
|
|
|
|
} |
1363
|
|
|
|
|
|
|
|
1364
|
|
|
|
|
|
|
sub test_for_error { |
1365
|
40
|
|
|
45
|
0
|
186
|
my ($self, $name, $code) = @_; |
1366
|
|
|
|
|
|
|
|
1367
|
40
|
|
|
|
|
318
|
my $data = $self->data('error', $name); |
1368
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
$code ||= sub { |
1370
|
40
|
|
|
45
|
|
150
|
length($data) > 1; |
1371
|
40
|
|
50
|
|
|
473
|
}; |
1372
|
|
|
|
|
|
|
|
1373
|
40
|
|
|
|
|
319
|
my $result = $code->(); |
1374
|
|
|
|
|
|
|
|
1375
|
40
|
|
|
|
|
247
|
$self->pass($result, "=error $name"); |
1376
|
|
|
|
|
|
|
|
1377
|
40
|
|
|
|
|
13383
|
return $result; |
1378
|
|
|
|
|
|
|
} |
1379
|
|
|
|
|
|
|
|
1380
|
|
|
|
|
|
|
sub test_for_example { |
1381
|
2713
|
|
|
2718
|
0
|
9175
|
my ($self, $number, $name, $code) = @_; |
1382
|
|
|
|
|
|
|
|
1383
|
2712
|
|
|
|
|
8688
|
my $data = $self->data('example', $number, $name); |
1384
|
|
|
|
|
|
|
|
1385
|
2712
|
|
|
|
|
5671
|
my @includes; |
1386
|
|
|
|
|
|
|
|
1387
|
2712
|
100
|
|
|
|
12704
|
if ($data =~ /# given: synopsis/) { |
1388
|
1057
|
|
|
|
|
4172
|
push @includes, $self->data('synopsis'); |
1389
|
|
|
|
|
|
|
} |
1390
|
|
|
|
|
|
|
|
1391
|
2712
|
|
|
|
|
10964
|
for my $given ($data =~ /# given: example-((?:\d+) (?:[\-\w]+))/gm) { |
1392
|
11
|
|
|
|
|
234
|
my ($number, $name) = split /\s+/, $given, 2; |
1393
|
11
|
|
|
|
|
86
|
push @includes, $self->data('example', $number, $name); |
1394
|
|
|
|
|
|
|
} |
1395
|
|
|
|
|
|
|
|
1396
|
2712
|
|
|
|
|
13894
|
$data =~ s/.*# given: .*\n\n*//g; |
1397
|
|
|
|
|
|
|
|
1398
|
2712
|
|
|
|
|
9475
|
$data = join "\n\n", @includes, $data; |
1399
|
|
|
|
|
|
|
|
1400
|
2712
|
|
|
|
|
8514
|
for my $attest ($data =~ /#\s*attest:\s*\w+:\s*[^\s]+,\s*.*/gm) { |
1401
|
9
|
|
|
|
|
21
|
my ($method, $left, $right) = $attest =~ /attest:\s*(\w+):\s*([^\s]+),\s*(.*)/; |
1402
|
9
|
|
|
|
|
142
|
my $snippet = qq($left = do { $self->pass($left->$method($right), "@{[quotemeta($&)]}"); $left };); |
|
7
|
|
|
|
|
51
|
|
1403
|
7
|
|
|
|
|
18
|
$data =~ s/@{[quotemeta($attest)]}/$snippet/; |
|
7
|
|
|
|
|
191
|
|
1404
|
|
|
|
|
|
|
} |
1405
|
|
|
|
|
|
|
|
1406
|
2710
|
|
50
|
15
|
|
7918
|
$code ||= sub{1}; |
|
7
|
|
|
|
|
20
|
|
1407
|
|
|
|
|
|
|
|
1408
|
2710
|
|
|
|
|
13815
|
my $result = $code->($self->try('eval', $data)); |
1409
|
|
|
|
|
|
|
|
1410
|
2706
|
|
|
|
|
254550
|
$self->pass($data, "=example-$number $name"); |
1411
|
2706
|
|
|
|
|
1088619
|
$self->pass($result, "=example-$number $name returns ok"); |
1412
|
|
|
|
|
|
|
|
1413
|
2706
|
|
|
|
|
1060235
|
return $result; |
1414
|
|
|
|
|
|
|
} |
1415
|
|
|
|
|
|
|
|
1416
|
|
|
|
|
|
|
sub test_for_feature { |
1417
|
22
|
|
|
30
|
0
|
123
|
my ($self, $name, $code) = @_; |
1418
|
|
|
|
|
|
|
|
1419
|
22
|
|
|
|
|
70
|
my $data = $self->data('feature', $name); |
1420
|
|
|
|
|
|
|
|
1421
|
|
|
|
|
|
|
$code ||= sub { |
1422
|
22
|
|
|
30
|
|
103
|
length($data) > 1; |
1423
|
22
|
|
50
|
|
|
291
|
}; |
1424
|
|
|
|
|
|
|
|
1425
|
22
|
|
|
|
|
61
|
my $result = $code->(); |
1426
|
|
|
|
|
|
|
|
1427
|
22
|
|
|
|
|
249
|
$self->pass($result, "=feature $name"); |
1428
|
|
|
|
|
|
|
|
1429
|
22
|
|
|
|
|
6336
|
return $result; |
1430
|
|
|
|
|
|
|
} |
1431
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
sub test_for_function { |
1433
|
7
|
|
|
15
|
0
|
23
|
my ($self, $name, $code) = @_; |
1434
|
|
|
|
|
|
|
|
1435
|
7
|
|
|
|
|
162
|
my $data = $self->data('function', $name); |
1436
|
|
|
|
|
|
|
|
1437
|
|
|
|
|
|
|
$code ||= sub { |
1438
|
7
|
|
|
14
|
|
28
|
length($data) > 1; |
1439
|
7
|
|
0
|
|
|
66
|
}; |
1440
|
|
|
|
|
|
|
|
1441
|
7
|
|
|
|
|
122
|
my $result = $code->(); |
1442
|
|
|
|
|
|
|
|
1443
|
7
|
|
|
|
|
55
|
$self->pass($result, "=function $name"); |
1444
|
|
|
|
|
|
|
|
1445
|
7
|
|
|
|
|
27
|
return $result; |
1446
|
|
|
|
|
|
|
} |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
sub test_for_include { |
1449
|
929
|
|
|
936
|
0
|
2518
|
my ($self, $text) = @_; |
1450
|
|
|
|
|
|
|
|
1451
|
929
|
|
|
|
|
2340
|
my ($type, $name) = @$text; |
1452
|
|
|
|
|
|
|
|
1453
|
929
|
|
|
|
|
3825
|
my $blocks = [$self->search({ list => $type, name => $name })]; |
1454
|
|
|
|
|
|
|
|
1455
|
929
|
|
|
|
|
6984
|
$self->pass(scalar(@$blocks), "=$type $name"); |
1456
|
|
|
|
|
|
|
|
1457
|
929
|
|
|
|
|
422032
|
return $blocks; |
1458
|
|
|
|
|
|
|
} |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
sub test_for_includes { |
1461
|
88
|
|
|
95
|
0
|
496
|
my ($self, $code) = @_; |
1462
|
|
|
|
|
|
|
|
1463
|
88
|
|
|
|
|
440
|
my $data = $self->data('includes'); |
1464
|
|
|
|
|
|
|
|
1465
|
88
|
|
33
|
|
|
1040
|
$code ||= $self->can('test_for_include'); |
1466
|
|
|
|
|
|
|
|
1467
|
88
|
|
|
|
|
401
|
$self->pass($data, "=includes"); |
1468
|
|
|
|
|
|
|
|
1469
|
88
|
|
|
|
|
36441
|
my $results = []; |
1470
|
|
|
|
|
|
|
|
1471
|
|
|
|
|
|
|
push @$results, $self->$code($_) |
1472
|
88
|
|
|
|
|
4523
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $data; |
1473
|
|
|
|
|
|
|
|
1474
|
88
|
|
|
|
|
940
|
return $results; |
1475
|
|
|
|
|
|
|
} |
1476
|
|
|
|
|
|
|
|
1477
|
|
|
|
|
|
|
sub test_for_inherits { |
1478
|
54
|
|
|
61
|
0
|
394
|
my ($self, $code) = @_; |
1479
|
|
|
|
|
|
|
|
1480
|
54
|
|
|
|
|
249
|
my $data = $self->data('inherits'); |
1481
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
$code ||= sub { |
1483
|
54
|
|
|
60
|
|
315
|
length($data) > 1; |
1484
|
54
|
|
50
|
|
|
559
|
}; |
1485
|
|
|
|
|
|
|
|
1486
|
54
|
|
|
|
|
226
|
my $result = $code->(); |
1487
|
|
|
|
|
|
|
|
1488
|
54
|
|
|
|
|
256
|
$self->pass($result, "=inherits"); |
1489
|
|
|
|
|
|
|
|
1490
|
54
|
|
|
|
|
20514
|
my $package = $self->data('name'); |
1491
|
|
|
|
|
|
|
|
1492
|
53
|
|
|
|
|
1030
|
$self->pass($package->isa($_), "$package isa $_") for split /\r?\n/, $data; |
1493
|
|
|
|
|
|
|
|
1494
|
53
|
|
|
|
|
20788
|
return $result; |
1495
|
|
|
|
|
|
|
} |
1496
|
|
|
|
|
|
|
|
1497
|
|
|
|
|
|
|
sub test_for_integrates { |
1498
|
32
|
|
|
39
|
0
|
312
|
my ($self, $code) = @_; |
1499
|
|
|
|
|
|
|
|
1500
|
32
|
|
|
|
|
143
|
my $data = $self->data('integrates'); |
1501
|
|
|
|
|
|
|
|
1502
|
|
|
|
|
|
|
$code ||= sub { |
1503
|
32
|
|
|
39
|
|
145
|
length($data) > 1; |
1504
|
32
|
|
50
|
|
|
317
|
}; |
1505
|
|
|
|
|
|
|
|
1506
|
31
|
|
|
|
|
141
|
my $result = $code->(); |
1507
|
|
|
|
|
|
|
|
1508
|
31
|
|
|
|
|
215
|
$self->pass($result, "=integrates"); |
1509
|
|
|
|
|
|
|
|
1510
|
31
|
|
|
|
|
12294
|
my $package = $self->data('name'); |
1511
|
|
|
|
|
|
|
|
1512
|
31
|
|
|
|
|
686
|
$self->pass($package->can('does'), "$package has does"); |
1513
|
31
|
|
|
|
|
11681
|
$self->pass($package->does($_), "$package does $_") for split /\r?\n/, $data; |
1514
|
|
|
|
|
|
|
|
1515
|
31
|
|
|
|
|
10755
|
return $result; |
1516
|
|
|
|
|
|
|
} |
1517
|
|
|
|
|
|
|
|
1518
|
|
|
|
|
|
|
sub test_for_libraries { |
1519
|
5
|
|
|
13
|
0
|
36
|
my ($self, $name, $code) = @_; |
1520
|
|
|
|
|
|
|
|
1521
|
5
|
|
|
|
|
11
|
my $data = $self->data('libraries'); |
1522
|
|
|
|
|
|
|
|
1523
|
|
|
|
|
|
|
$code ||= sub { |
1524
|
5
|
|
|
13
|
|
36
|
length($data) > 1; |
1525
|
5
|
|
0
|
|
|
146
|
}; |
1526
|
|
|
|
|
|
|
|
1527
|
5
|
|
|
|
|
16
|
my $result = $code->(); |
1528
|
|
|
|
|
|
|
|
1529
|
5
|
|
|
|
|
115
|
$self->pass($result, "=libraries"); |
1530
|
5
|
|
|
|
|
39
|
$self->pass(scalar(eval("require $_")), "$_ ok") for split /\r?\n/, $data; |
1531
|
|
|
|
|
|
|
|
1532
|
5
|
|
|
|
|
16
|
return $result; |
1533
|
|
|
|
|
|
|
} |
1534
|
|
|
|
|
|
|
|
1535
|
|
|
|
|
|
|
sub test_for_license { |
1536
|
5
|
|
|
13
|
0
|
148
|
my ($self, $name, $code) = @_; |
1537
|
|
|
|
|
|
|
|
1538
|
5
|
|
|
|
|
35
|
my $data = $self->data('license'); |
1539
|
|
|
|
|
|
|
|
1540
|
|
|
|
|
|
|
$code ||= sub { |
1541
|
5
|
|
|
13
|
|
46
|
length($data) > 1; |
1542
|
5
|
|
0
|
|
|
14
|
}; |
1543
|
|
|
|
|
|
|
|
1544
|
5
|
|
|
|
|
35
|
my $result = $code->(); |
1545
|
|
|
|
|
|
|
|
1546
|
5
|
|
|
|
|
18
|
$self->pass($result, "=license"); |
1547
|
|
|
|
|
|
|
|
1548
|
5
|
|
|
|
|
199
|
return $result; |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
|
1551
|
|
|
|
|
|
|
sub test_for_message { |
1552
|
5
|
|
|
13
|
0
|
36
|
my ($self, $name, $code) = @_; |
1553
|
|
|
|
|
|
|
|
1554
|
5
|
|
|
|
|
17
|
my $data = $self->data('message', $name); |
1555
|
|
|
|
|
|
|
|
1556
|
|
|
|
|
|
|
$code ||= sub { |
1557
|
5
|
|
|
13
|
|
44
|
length($data) > 1; |
1558
|
5
|
|
0
|
|
|
83
|
}; |
1559
|
|
|
|
|
|
|
|
1560
|
5
|
|
|
|
|
19
|
my $result = $code->(); |
1561
|
|
|
|
|
|
|
|
1562
|
5
|
|
|
|
|
80
|
$self->pass($result, "=message $name"); |
1563
|
|
|
|
|
|
|
|
1564
|
5
|
|
|
|
|
42
|
return $result; |
1565
|
|
|
|
|
|
|
} |
1566
|
|
|
|
|
|
|
|
1567
|
|
|
|
|
|
|
sub test_for_method { |
1568
|
5
|
|
|
12
|
0
|
15
|
my ($self, $name, $code) = @_; |
1569
|
|
|
|
|
|
|
|
1570
|
5
|
|
|
|
|
171
|
my $data = $self->data('method', $name); |
1571
|
|
|
|
|
|
|
|
1572
|
|
|
|
|
|
|
$code ||= sub { |
1573
|
5
|
|
|
12
|
|
13
|
length($data) > 1; |
1574
|
5
|
|
0
|
|
|
42
|
}; |
1575
|
|
|
|
|
|
|
|
1576
|
5
|
|
|
|
|
137
|
my $result = $code->(); |
1577
|
|
|
|
|
|
|
|
1578
|
5
|
|
|
|
|
31
|
$self->pass($result, "=method $name"); |
1579
|
|
|
|
|
|
|
|
1580
|
5
|
|
|
|
|
15
|
my $package = $self->data('name'); |
1581
|
|
|
|
|
|
|
|
1582
|
5
|
|
|
|
|
40
|
$self->pass($package->can($name), "$package has $name"); |
1583
|
|
|
|
|
|
|
|
1584
|
5
|
|
|
|
|
55
|
return $result; |
1585
|
|
|
|
|
|
|
} |
1586
|
|
|
|
|
|
|
|
1587
|
|
|
|
|
|
|
sub test_for_name { |
1588
|
91
|
|
|
98
|
0
|
381
|
my ($self, $code) = @_; |
1589
|
|
|
|
|
|
|
|
1590
|
91
|
|
|
|
|
645
|
my $data = $self->data('name'); |
1591
|
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
|
$code ||= sub { |
1593
|
91
|
|
|
97
|
|
396
|
length($data) > 1; |
1594
|
91
|
|
50
|
|
|
1050
|
}; |
1595
|
|
|
|
|
|
|
|
1596
|
91
|
|
|
|
|
418
|
my $result = $code->(); |
1597
|
|
|
|
|
|
|
|
1598
|
91
|
|
|
|
|
497
|
$self->pass($result, $self->desc('=name')); |
1599
|
91
|
|
|
|
|
55288
|
$self->pass(scalar(eval("require $data")), $self->desc('require', $data)); |
1600
|
|
|
|
|
|
|
|
1601
|
91
|
|
|
|
|
37298
|
return $result; |
1602
|
|
|
|
|
|
|
} |
1603
|
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
|
sub test_for_operator { |
1605
|
77
|
|
|
83
|
0
|
339
|
my ($self, $name, $code) = @_; |
1606
|
|
|
|
|
|
|
|
1607
|
77
|
|
|
|
|
316
|
my $data = $self->data('operator', $name); |
1608
|
|
|
|
|
|
|
|
1609
|
|
|
|
|
|
|
$code ||= sub { |
1610
|
77
|
|
|
83
|
|
286
|
length($data) > 1; |
1611
|
77
|
|
50
|
|
|
1319
|
}; |
1612
|
|
|
|
|
|
|
|
1613
|
77
|
|
|
|
|
249
|
my $result = $code->(); |
1614
|
|
|
|
|
|
|
|
1615
|
77
|
|
|
|
|
950
|
$self->pass($result, "=operator $name"); |
1616
|
|
|
|
|
|
|
|
1617
|
77
|
|
|
|
|
32136
|
return $result; |
1618
|
|
|
|
|
|
|
} |
1619
|
|
|
|
|
|
|
|
1620
|
|
|
|
|
|
|
sub test_for_partial { |
1621
|
177
|
|
|
183
|
0
|
766
|
my ($self, $text) = @_; |
1622
|
|
|
|
|
|
|
|
1623
|
177
|
|
|
|
|
751
|
my ($file, $method, @args) = @$text; |
1624
|
|
|
|
|
|
|
|
1625
|
177
|
|
|
|
|
1788
|
my $test = $self->class->new($file); |
1626
|
|
|
|
|
|
|
|
1627
|
177
|
|
|
|
|
566
|
my $content; |
1628
|
|
|
|
|
|
|
|
1629
|
177
|
|
33
|
|
|
6773
|
$self->pass((-f $file && ($content = $test->$method(@args))), |
1630
|
|
|
|
|
|
|
"$file: $method: @args"); |
1631
|
|
|
|
|
|
|
|
1632
|
177
|
|
|
|
|
125887
|
return $content; |
1633
|
|
|
|
|
|
|
} |
1634
|
|
|
|
|
|
|
|
1635
|
|
|
|
|
|
|
sub test_for_partials { |
1636
|
91
|
|
|
97
|
0
|
528
|
my ($self, $code) = @_; |
1637
|
|
|
|
|
|
|
|
1638
|
91
|
|
|
|
|
494
|
my $data = $self->data('partials'); |
1639
|
|
|
|
|
|
|
|
1640
|
91
|
|
33
|
|
|
1321
|
$code ||= $self->can('test_for_partial'); |
1641
|
|
|
|
|
|
|
|
1642
|
91
|
|
|
|
|
485
|
$self->pass($data, '=partials'); |
1643
|
|
|
|
|
|
|
|
1644
|
91
|
|
|
|
|
38438
|
my $results = []; |
1645
|
|
|
|
|
|
|
|
1646
|
|
|
|
|
|
|
push @$results, $self->$code($_) |
1647
|
91
|
|
|
|
|
2719
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $data; |
1648
|
|
|
|
|
|
|
|
1649
|
91
|
|
|
|
|
780
|
return $results; |
1650
|
|
|
|
|
|
|
} |
1651
|
|
|
|
|
|
|
|
1652
|
|
|
|
|
|
|
sub test_for_project { |
1653
|
5
|
|
|
11
|
0
|
38
|
my ($self, $name, $code) = @_; |
1654
|
|
|
|
|
|
|
|
1655
|
5
|
|
|
|
|
46
|
my $data = $self->data('project'); |
1656
|
|
|
|
|
|
|
|
1657
|
|
|
|
|
|
|
$code ||= sub { |
1658
|
5
|
|
|
11
|
|
242
|
length($data) > 1; |
1659
|
5
|
|
0
|
|
|
14
|
}; |
1660
|
|
|
|
|
|
|
|
1661
|
5
|
|
|
|
|
35
|
my $result = $code->(); |
1662
|
|
|
|
|
|
|
|
1663
|
5
|
|
|
|
|
12
|
$self->pass($result, "=project"); |
1664
|
|
|
|
|
|
|
|
1665
|
5
|
|
|
|
|
38
|
return $result; |
1666
|
|
|
|
|
|
|
} |
1667
|
|
|
|
|
|
|
|
1668
|
|
|
|
|
|
|
sub test_for_synopsis { |
1669
|
91
|
|
|
97
|
0
|
509
|
my ($self, $code) = @_; |
1670
|
|
|
|
|
|
|
|
1671
|
91
|
|
|
|
|
447
|
my $data = $self->data('synopsis'); |
1672
|
|
|
|
|
|
|
|
1673
|
91
|
|
|
|
|
511
|
my @includes; |
1674
|
|
|
|
|
|
|
|
1675
|
91
|
|
|
|
|
623
|
for my $given ($data =~ /# given: example-((?:\d+) (?:[\-\w]+))/gm) { |
1676
|
5
|
|
|
|
|
15
|
my ($number, $name) = split /\s+/, $given, 2; |
1677
|
5
|
|
|
|
|
105
|
push @includes, $self->data('example', $number, $name); |
1678
|
|
|
|
|
|
|
} |
1679
|
|
|
|
|
|
|
|
1680
|
91
|
|
|
|
|
420
|
$data =~ s/.*# given: .*\n\n*//g; |
1681
|
|
|
|
|
|
|
|
1682
|
91
|
|
|
|
|
350
|
$data = join "\n\n", @includes, $data; |
1683
|
|
|
|
|
|
|
|
1684
|
91
|
|
|
|
|
667
|
for my $attest ($data =~ /#\s*attest:\s*\w+:\s*[^\s]+,\s*.*/gm) { |
1685
|
5
|
|
|
|
|
38
|
my ($method, $left, $right) = $attest =~ /attest:\s*(\w+):\s*([^\s]+),\s*(.*)/; |
1686
|
5
|
|
|
|
|
15
|
my $snippet = qq($left = do { $self->pass($left->$method($right), "@{[quotemeta($&)]}"); $left };); |
|
5
|
|
|
|
|
39
|
|
1687
|
5
|
|
|
|
|
42
|
$data =~ s/@{[quotemeta($attest)]}/$snippet/; |
|
5
|
|
|
|
|
14
|
|
1688
|
|
|
|
|
|
|
} |
1689
|
|
|
|
|
|
|
|
1690
|
91
|
|
50
|
11
|
|
607
|
$code ||= sub{$_[0]->result}; |
|
5
|
|
|
|
|
35
|
|
1691
|
|
|
|
|
|
|
|
1692
|
91
|
|
|
|
|
720
|
my $result = $code->($self->try('eval', $data)); |
1693
|
|
|
|
|
|
|
|
1694
|
91
|
|
|
|
|
4475
|
$self->pass($data, "=synopsis"); |
1695
|
91
|
|
|
|
|
37488
|
$self->pass($result, "=synopsis returns ok"); |
1696
|
|
|
|
|
|
|
|
1697
|
91
|
|
|
|
|
36051
|
return $result; |
1698
|
|
|
|
|
|
|
} |
1699
|
|
|
|
|
|
|
|
1700
|
|
|
|
|
|
|
sub test_for_tagline { |
1701
|
91
|
|
|
97
|
0
|
865
|
my ($self, $name, $code) = @_; |
1702
|
|
|
|
|
|
|
|
1703
|
91
|
|
|
|
|
443
|
my $data = $self->data('tagline'); |
1704
|
|
|
|
|
|
|
|
1705
|
|
|
|
|
|
|
$code ||= sub { |
1706
|
91
|
|
|
97
|
|
386
|
length($data) > 1; |
1707
|
91
|
|
50
|
|
|
1026
|
}; |
1708
|
|
|
|
|
|
|
|
1709
|
91
|
|
|
|
|
385
|
my $result = $code->(); |
1710
|
|
|
|
|
|
|
|
1711
|
91
|
|
|
|
|
420
|
$self->pass($result, "=tagline"); |
1712
|
|
|
|
|
|
|
|
1713
|
91
|
|
|
|
|
38964
|
return $result; |
1714
|
|
|
|
|
|
|
} |
1715
|
|
|
|
|
|
|
|
1716
|
|
|
|
|
|
|
sub test_for_version { |
1717
|
5
|
|
|
11
|
0
|
28
|
my ($self, $name, $code) = @_; |
1718
|
|
|
|
|
|
|
|
1719
|
5
|
|
|
|
|
17
|
my $data = $self->data('version'); |
1720
|
|
|
|
|
|
|
|
1721
|
|
|
|
|
|
|
$code ||= sub { |
1722
|
5
|
|
|
11
|
|
47
|
length($data) > 1; |
1723
|
5
|
|
0
|
|
|
38
|
}; |
1724
|
|
|
|
|
|
|
|
1725
|
5
|
|
|
|
|
16
|
my $result = $code->(); |
1726
|
|
|
|
|
|
|
|
1727
|
5
|
|
|
|
|
244
|
$self->pass($result, "=version"); |
1728
|
|
|
|
|
|
|
|
1729
|
5
|
|
|
|
|
34
|
my $package = $self->data('name'); |
1730
|
|
|
|
|
|
|
|
1731
|
5
|
|
0
|
|
|
20
|
$self->pass(($package->VERSION // '') eq $data, "$data matched"); |
1732
|
|
|
|
|
|
|
|
1733
|
5
|
|
|
|
|
37
|
return $result; |
1734
|
|
|
|
|
|
|
} |
1735
|
|
|
|
|
|
|
|
1736
|
|
|
|
|
|
|
sub text { |
1737
|
245
|
|
|
251
|
1
|
941
|
my ($self, $name, @args) = @_; |
1738
|
|
|
|
|
|
|
|
1739
|
245
|
|
|
|
|
794
|
my $method = "text_for_$name"; |
1740
|
|
|
|
|
|
|
|
1741
|
245
|
100
|
|
|
|
1691
|
$self->error("on.text.$name") if !$self->can($method); |
1742
|
|
|
|
|
|
|
|
1743
|
244
|
|
|
|
|
1320
|
my $result = $self->$method(@args); |
1744
|
|
|
|
|
|
|
|
1745
|
244
|
|
|
|
|
1330
|
return join "\n", @$result; |
1746
|
|
|
|
|
|
|
} |
1747
|
|
|
|
|
|
|
|
1748
|
|
|
|
|
|
|
sub text_for_abstract { |
1749
|
6
|
|
|
12
|
0
|
42
|
my ($self) = @_; |
1750
|
|
|
|
|
|
|
|
1751
|
6
|
|
|
|
|
41
|
my ($error, $result) = $self->catch('data', 'abstract'); |
1752
|
|
|
|
|
|
|
|
1753
|
6
|
|
|
|
|
20
|
my $output = []; |
1754
|
|
|
|
|
|
|
|
1755
|
6
|
50
|
|
|
|
269
|
if (!$error) { |
1756
|
6
|
|
|
|
|
37
|
push @$output, $result; |
1757
|
|
|
|
|
|
|
} |
1758
|
|
|
|
|
|
|
|
1759
|
6
|
|
|
|
|
14
|
return $output; |
1760
|
|
|
|
|
|
|
} |
1761
|
|
|
|
|
|
|
|
1762
|
|
|
|
|
|
|
sub text_for_attribute { |
1763
|
5
|
|
|
11
|
0
|
45
|
my ($self, $name) = @_; |
1764
|
|
|
|
|
|
|
|
1765
|
4
|
|
|
|
|
38
|
my ($error, $result) = $self->catch('data', 'attribute', $name); |
1766
|
|
|
|
|
|
|
|
1767
|
4
|
|
|
|
|
14
|
my $output = []; |
1768
|
|
|
|
|
|
|
|
1769
|
4
|
0
|
|
|
|
208
|
if (!$error) { |
1770
|
4
|
|
|
|
|
25
|
push @$output, $result; |
1771
|
|
|
|
|
|
|
} |
1772
|
|
|
|
|
|
|
|
1773
|
4
|
|
|
|
|
14
|
return $output; |
1774
|
|
|
|
|
|
|
} |
1775
|
|
|
|
|
|
|
|
1776
|
|
|
|
|
|
|
sub text_for_attributes { |
1777
|
6
|
|
|
13
|
0
|
42
|
my ($self) = @_; |
1778
|
|
|
|
|
|
|
|
1779
|
6
|
|
|
|
|
50
|
my ($error, $result) = $self->catch('data', 'attributes'); |
1780
|
|
|
|
|
|
|
|
1781
|
6
|
|
|
|
|
19
|
my $output = []; |
1782
|
|
|
|
|
|
|
|
1783
|
6
|
50
|
|
|
|
231
|
if (!$error) { |
1784
|
4
|
|
|
|
|
25
|
push @$output, $result; |
1785
|
|
|
|
|
|
|
} |
1786
|
|
|
|
|
|
|
|
1787
|
6
|
|
|
|
|
25
|
return $output; |
1788
|
|
|
|
|
|
|
} |
1789
|
|
|
|
|
|
|
|
1790
|
|
|
|
|
|
|
sub text_for_authors { |
1791
|
92
|
|
|
99
|
0
|
328
|
my ($self) = @_; |
1792
|
|
|
|
|
|
|
|
1793
|
92
|
|
|
|
|
740
|
my ($error, $result) = $self->catch('data', 'authors'); |
1794
|
|
|
|
|
|
|
|
1795
|
92
|
|
|
|
|
332
|
my $output = []; |
1796
|
|
|
|
|
|
|
|
1797
|
92
|
100
|
|
|
|
744
|
if (!$error) { |
1798
|
91
|
|
|
|
|
312
|
push @$output, $result; |
1799
|
|
|
|
|
|
|
} |
1800
|
|
|
|
|
|
|
|
1801
|
92
|
|
|
|
|
315
|
return $output; |
1802
|
|
|
|
|
|
|
} |
1803
|
|
|
|
|
|
|
|
1804
|
|
|
|
|
|
|
sub text_for_description { |
1805
|
5
|
|
|
12
|
0
|
39
|
my ($self) = @_; |
1806
|
|
|
|
|
|
|
|
1807
|
5
|
|
|
|
|
47
|
my ($error, $result) = $self->catch('data', 'description'); |
1808
|
|
|
|
|
|
|
|
1809
|
5
|
|
|
|
|
24
|
my $output = []; |
1810
|
|
|
|
|
|
|
|
1811
|
5
|
50
|
|
|
|
210
|
if (!$error) { |
1812
|
5
|
|
|
|
|
39
|
push @$output, $result; |
1813
|
|
|
|
|
|
|
} |
1814
|
|
|
|
|
|
|
|
1815
|
5
|
|
|
|
|
13
|
return $output; |
1816
|
|
|
|
|
|
|
} |
1817
|
|
|
|
|
|
|
|
1818
|
|
|
|
|
|
|
sub text_for_encoding { |
1819
|
5
|
|
|
12
|
0
|
42
|
my ($self) = @_; |
1820
|
|
|
|
|
|
|
|
1821
|
5
|
|
|
|
|
31
|
my ($error, $result) = $self->catch('data', 'encoding'); |
1822
|
|
|
|
|
|
|
|
1823
|
5
|
|
|
|
|
16
|
my $output = []; |
1824
|
|
|
|
|
|
|
|
1825
|
5
|
50
|
|
|
|
157
|
if (!$error) { |
1826
|
4
|
|
|
|
|
27
|
push @$output, $result; |
1827
|
|
|
|
|
|
|
} |
1828
|
|
|
|
|
|
|
|
1829
|
5
|
|
|
|
|
19
|
return $output; |
1830
|
|
|
|
|
|
|
} |
1831
|
|
|
|
|
|
|
|
1832
|
|
|
|
|
|
|
sub text_for_error { |
1833
|
4
|
|
|
11
|
0
|
75
|
my ($self, $name) = @_; |
1834
|
|
|
|
|
|
|
|
1835
|
4
|
|
|
|
|
33
|
my ($error, $result) = $self->catch('data', 'error', $name); |
1836
|
|
|
|
|
|
|
|
1837
|
4
|
|
|
|
|
9
|
my $output = []; |
1838
|
|
|
|
|
|
|
|
1839
|
4
|
0
|
|
|
|
158
|
if (!$error) { |
1840
|
4
|
|
|
|
|
48
|
push @$output, $result; |
1841
|
|
|
|
|
|
|
} |
1842
|
|
|
|
|
|
|
|
1843
|
4
|
|
|
|
|
28
|
return $output; |
1844
|
|
|
|
|
|
|
} |
1845
|
|
|
|
|
|
|
|
1846
|
|
|
|
|
|
|
sub text_for_example { |
1847
|
19
|
|
|
26
|
0
|
115
|
my ($self, $number, $name) = @_; |
1848
|
|
|
|
|
|
|
|
1849
|
19
|
|
|
|
|
75
|
my $output = []; |
1850
|
|
|
|
|
|
|
|
1851
|
19
|
|
|
|
|
119
|
my $data = $self->search({ |
1852
|
|
|
|
|
|
|
list => "example-$number", |
1853
|
|
|
|
|
|
|
name => $name, |
1854
|
|
|
|
|
|
|
}); |
1855
|
|
|
|
|
|
|
|
1856
|
19
|
50
|
|
|
|
303
|
push @$output, join "\n\n", @{$data->[0]{data}} if @$data; |
|
19
|
|
|
|
|
98
|
|
1857
|
|
|
|
|
|
|
|
1858
|
19
|
|
|
|
|
58
|
return $output; |
1859
|
|
|
|
|
|
|
} |
1860
|
|
|
|
|
|
|
|
1861
|
|
|
|
|
|
|
sub text_for_feature { |
1862
|
4
|
|
|
11
|
0
|
32
|
my ($self, $name) = @_; |
1863
|
|
|
|
|
|
|
|
1864
|
4
|
|
|
|
|
32
|
my ($error, $result) = $self->catch('data', 'feature', $name); |
1865
|
|
|
|
|
|
|
|
1866
|
4
|
|
|
|
|
15
|
my $output = []; |
1867
|
|
|
|
|
|
|
|
1868
|
4
|
0
|
|
|
|
195
|
if (!$error) { |
1869
|
4
|
|
|
|
|
26
|
push @$output, $result; |
1870
|
|
|
|
|
|
|
} |
1871
|
|
|
|
|
|
|
|
1872
|
4
|
|
|
|
|
13
|
return $output; |
1873
|
|
|
|
|
|
|
} |
1874
|
|
|
|
|
|
|
|
1875
|
|
|
|
|
|
|
sub text_for_function { |
1876
|
5
|
|
|
12
|
0
|
102
|
my ($self, $name) = @_; |
1877
|
|
|
|
|
|
|
|
1878
|
5
|
|
|
|
|
77
|
my ($error, $result) = $self->catch('data', 'function', $name); |
1879
|
|
|
|
|
|
|
|
1880
|
5
|
|
|
|
|
13
|
my $output = []; |
1881
|
|
|
|
|
|
|
|
1882
|
5
|
50
|
|
|
|
180
|
if (!$error) { |
1883
|
5
|
|
|
|
|
30
|
push @$output, $result; |
1884
|
|
|
|
|
|
|
} |
1885
|
|
|
|
|
|
|
|
1886
|
5
|
|
|
|
|
12
|
return $output; |
1887
|
|
|
|
|
|
|
} |
1888
|
|
|
|
|
|
|
|
1889
|
|
|
|
|
|
|
sub text_for_heading { |
1890
|
8
|
|
|
15
|
0
|
103
|
my ($self, $name) = @_; |
1891
|
|
|
|
|
|
|
|
1892
|
8
|
|
|
|
|
47
|
my ($error, $result) = $self->catch('data', 'heading', $name); |
1893
|
|
|
|
|
|
|
|
1894
|
8
|
|
|
|
|
22
|
my $output = []; |
1895
|
|
|
|
|
|
|
|
1896
|
8
|
50
|
|
|
|
144
|
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
|
77
|
my ($self) = @_; |
1905
|
|
|
|
|
|
|
|
1906
|
4
|
|
|
|
|
32
|
my ($error, $result) = $self->catch('data', 'include'); |
1907
|
|
|
|
|
|
|
|
1908
|
4
|
|
|
|
|
13
|
my $output = []; |
1909
|
|
|
|
|
|
|
|
1910
|
4
|
0
|
|
|
|
137
|
if (!$error) { |
1911
|
4
|
|
|
|
|
26
|
push @$output, $result; |
1912
|
|
|
|
|
|
|
} |
1913
|
|
|
|
|
|
|
|
1914
|
4
|
|
|
|
|
10
|
return $output; |
1915
|
|
|
|
|
|
|
} |
1916
|
|
|
|
|
|
|
|
1917
|
|
|
|
|
|
|
sub text_for_includes { |
1918
|
7
|
|
|
14
|
0
|
101
|
my ($self) = @_; |
1919
|
|
|
|
|
|
|
|
1920
|
7
|
|
|
|
|
41
|
my ($error, $result) = $self->catch('data', 'includes'); |
1921
|
|
|
|
|
|
|
|
1922
|
7
|
|
|
|
|
25
|
my $output = []; |
1923
|
|
|
|
|
|
|
|
1924
|
7
|
50
|
|
|
|
195
|
if (!$error) { |
1925
|
7
|
|
|
|
|
41
|
push @$output, $result; |
1926
|
|
|
|
|
|
|
} |
1927
|
|
|
|
|
|
|
|
1928
|
7
|
|
|
|
|
17
|
return $output; |
1929
|
|
|
|
|
|
|
} |
1930
|
|
|
|
|
|
|
|
1931
|
|
|
|
|
|
|
sub text_for_inherits { |
1932
|
6
|
|
|
13
|
0
|
96
|
my ($self) = @_; |
1933
|
|
|
|
|
|
|
|
1934
|
6
|
|
|
|
|
40
|
my ($error, $result) = $self->catch('data', 'inherits'); |
1935
|
|
|
|
|
|
|
|
1936
|
6
|
|
|
|
|
16
|
my $output = []; |
1937
|
|
|
|
|
|
|
|
1938
|
6
|
50
|
|
|
|
130
|
if (!$error) { |
1939
|
6
|
|
|
|
|
36
|
push @$output, $result; |
1940
|
|
|
|
|
|
|
} |
1941
|
|
|
|
|
|
|
|
1942
|
6
|
|
|
|
|
14
|
return $output; |
1943
|
|
|
|
|
|
|
} |
1944
|
|
|
|
|
|
|
|
1945
|
|
|
|
|
|
|
sub text_for_integrates { |
1946
|
6
|
|
|
13
|
0
|
74
|
my ($self) = @_; |
1947
|
|
|
|
|
|
|
|
1948
|
6
|
|
|
|
|
37
|
my ($error, $result) = $self->catch('data', 'integrates'); |
1949
|
|
|
|
|
|
|
|
1950
|
6
|
|
|
|
|
15
|
my $output = []; |
1951
|
|
|
|
|
|
|
|
1952
|
6
|
50
|
|
|
|
137
|
if (!$error) { |
1953
|
6
|
|
|
|
|
37
|
push @$output, $result; |
1954
|
|
|
|
|
|
|
} |
1955
|
|
|
|
|
|
|
|
1956
|
6
|
|
|
|
|
15
|
return $output; |
1957
|
|
|
|
|
|
|
} |
1958
|
|
|
|
|
|
|
|
1959
|
|
|
|
|
|
|
sub text_for_layout { |
1960
|
4
|
|
|
11
|
0
|
66
|
my ($self) = @_; |
1961
|
|
|
|
|
|
|
|
1962
|
4
|
|
|
|
|
29
|
my ($error, $result) = $self->catch('data', 'layout'); |
1963
|
|
|
|
|
|
|
|
1964
|
4
|
|
|
|
|
10
|
my $output = []; |
1965
|
|
|
|
|
|
|
|
1966
|
4
|
0
|
|
|
|
123
|
if (!$error) { |
1967
|
4
|
|
|
|
|
29
|
push @$output, $result; |
1968
|
|
|
|
|
|
|
} |
1969
|
|
|
|
|
|
|
|
1970
|
4
|
|
|
|
|
13
|
return $output; |
1971
|
|
|
|
|
|
|
} |
1972
|
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
|
sub text_for_libraries { |
1974
|
6
|
|
|
13
|
0
|
89
|
my ($self) = @_; |
1975
|
|
|
|
|
|
|
|
1976
|
6
|
|
|
|
|
38
|
my ($error, $result) = $self->catch('data', 'libraries'); |
1977
|
|
|
|
|
|
|
|
1978
|
6
|
|
|
|
|
18
|
my $output = []; |
1979
|
|
|
|
|
|
|
|
1980
|
6
|
50
|
|
|
|
175
|
if (!$error) { |
1981
|
4
|
|
|
|
|
32
|
push @$output, $result; |
1982
|
|
|
|
|
|
|
} |
1983
|
|
|
|
|
|
|
|
1984
|
6
|
|
|
|
|
23
|
return $output; |
1985
|
|
|
|
|
|
|
} |
1986
|
|
|
|
|
|
|
|
1987
|
|
|
|
|
|
|
sub text_for_license { |
1988
|
92
|
|
|
99
|
0
|
402
|
my ($self) = @_; |
1989
|
|
|
|
|
|
|
|
1990
|
91
|
|
|
|
|
759
|
my ($error, $result) = $self->catch('data', 'license'); |
1991
|
|
|
|
|
|
|
|
1992
|
91
|
|
|
|
|
382
|
my $output = []; |
1993
|
|
|
|
|
|
|
|
1994
|
91
|
100
|
|
|
|
510
|
if (!$error) { |
1995
|
90
|
|
|
|
|
304
|
push @$output, $result; |
1996
|
|
|
|
|
|
|
} |
1997
|
|
|
|
|
|
|
|
1998
|
91
|
|
|
|
|
331
|
return $output; |
1999
|
|
|
|
|
|
|
} |
2000
|
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
|
sub text_for_message { |
2002
|
3
|
|
|
11
|
0
|
99
|
my ($self, $name) = @_; |
2003
|
|
|
|
|
|
|
|
2004
|
3
|
|
|
|
|
31
|
my ($error, $result) = $self->catch('data', 'message', $name); |
2005
|
|
|
|
|
|
|
|
2006
|
3
|
|
|
|
|
10
|
my $output = []; |
2007
|
|
|
|
|
|
|
|
2008
|
3
|
0
|
|
|
|
93
|
if (!$error) { |
2009
|
3
|
|
|
|
|
21
|
push @$output, $result; |
2010
|
|
|
|
|
|
|
} |
2011
|
|
|
|
|
|
|
|
2012
|
3
|
|
|
|
|
14
|
return $output; |
2013
|
|
|
|
|
|
|
} |
2014
|
|
|
|
|
|
|
|
2015
|
|
|
|
|
|
|
sub text_for_metadata { |
2016
|
9
|
|
|
17
|
0
|
46
|
my ($self, $name) = @_; |
2017
|
|
|
|
|
|
|
|
2018
|
9
|
|
|
|
|
61
|
my ($error, $result) = $self->catch('data', 'metadata', $name); |
2019
|
|
|
|
|
|
|
|
2020
|
9
|
|
|
|
|
26
|
my $output = []; |
2021
|
|
|
|
|
|
|
|
2022
|
9
|
50
|
|
|
|
172
|
if (!$error) { |
2023
|
9
|
|
|
|
|
41
|
push @$output, $result; |
2024
|
|
|
|
|
|
|
} |
2025
|
|
|
|
|
|
|
|
2026
|
9
|
|
|
|
|
21
|
return $output; |
2027
|
|
|
|
|
|
|
} |
2028
|
|
|
|
|
|
|
|
2029
|
|
|
|
|
|
|
sub text_for_method { |
2030
|
8
|
|
|
15
|
0
|
38
|
my ($self, $name) = @_; |
2031
|
|
|
|
|
|
|
|
2032
|
8
|
|
|
|
|
52
|
my ($error, $result) = $self->catch('data', 'method', $name); |
2033
|
|
|
|
|
|
|
|
2034
|
8
|
|
|
|
|
24
|
my $output = []; |
2035
|
|
|
|
|
|
|
|
2036
|
8
|
50
|
|
|
|
113
|
if (!$error) { |
2037
|
8
|
|
|
|
|
36
|
push @$output, $result; |
2038
|
|
|
|
|
|
|
} |
2039
|
|
|
|
|
|
|
|
2040
|
8
|
|
|
|
|
20
|
return $output; |
2041
|
|
|
|
|
|
|
} |
2042
|
|
|
|
|
|
|
|
2043
|
|
|
|
|
|
|
sub text_for_name { |
2044
|
7
|
|
|
14
|
0
|
109
|
my ($self) = @_; |
2045
|
|
|
|
|
|
|
|
2046
|
7
|
|
|
|
|
41
|
my ($error, $result) = $self->catch('data', 'name'); |
2047
|
|
|
|
|
|
|
|
2048
|
7
|
|
|
|
|
22
|
my $output = []; |
2049
|
|
|
|
|
|
|
|
2050
|
7
|
50
|
|
|
|
101
|
if (!$error) { |
2051
|
7
|
|
|
|
|
38
|
push @$output, $result; |
2052
|
|
|
|
|
|
|
} |
2053
|
|
|
|
|
|
|
|
2054
|
7
|
|
|
|
|
20
|
return $output; |
2055
|
|
|
|
|
|
|
} |
2056
|
|
|
|
|
|
|
|
2057
|
|
|
|
|
|
|
sub text_for_operator { |
2058
|
3
|
|
|
10
|
0
|
63
|
my ($self, $name) = @_; |
2059
|
|
|
|
|
|
|
|
2060
|
2
|
|
|
|
|
17
|
my ($error, $result) = $self->catch('data', 'operator', $name); |
2061
|
|
|
|
|
|
|
|
2062
|
2
|
|
|
|
|
6
|
my $output = []; |
2063
|
|
|
|
|
|
|
|
2064
|
2
|
0
|
|
|
|
80
|
if (!$error) { |
2065
|
2
|
|
|
|
|
15
|
push @$output, $result; |
2066
|
|
|
|
|
|
|
} |
2067
|
|
|
|
|
|
|
|
2068
|
2
|
|
|
|
|
5
|
return $output; |
2069
|
|
|
|
|
|
|
} |
2070
|
|
|
|
|
|
|
|
2071
|
|
|
|
|
|
|
sub text_for_partial { |
2072
|
4
|
|
|
12
|
0
|
28
|
my ($self, $text) = @_; |
2073
|
|
|
|
|
|
|
|
2074
|
4
|
|
|
|
|
33
|
my ($file, $method, @args) = @$text; |
2075
|
|
|
|
|
|
|
|
2076
|
4
|
|
|
|
|
27
|
my $test = $self->class->new($file); |
2077
|
|
|
|
|
|
|
|
2078
|
4
|
|
|
|
|
131
|
return [$test->$method(@args)]; |
2079
|
|
|
|
|
|
|
} |
2080
|
|
|
|
|
|
|
|
2081
|
|
|
|
|
|
|
sub text_for_partials { |
2082
|
3
|
|
|
11
|
0
|
613
|
my ($self) = @_; |
2083
|
|
|
|
|
|
|
|
2084
|
3
|
|
|
|
|
364
|
my ($error, $result) = $self->catch('data', 'partials'); |
2085
|
|
|
|
|
|
|
|
2086
|
3
|
|
|
|
|
30
|
my $output = []; |
2087
|
|
|
|
|
|
|
|
2088
|
3
|
50
|
|
|
|
21
|
if (!$error) { |
2089
|
|
|
|
|
|
|
push @$output, $self->text('partial', $_) |
2090
|
3
|
|
|
|
|
33
|
for map [split /\:\s*/], grep /\w/, grep !/^#/, split /\r?\n/, $result; |
2091
|
|
|
|
|
|
|
} |
2092
|
|
|
|
|
|
|
|
2093
|
3
|
|
|
|
|
125
|
return $output; |
2094
|
|
|
|
|
|
|
} |
2095
|
|
|
|
|
|
|
|
2096
|
|
|
|
|
|
|
sub text_for_project { |
2097
|
3
|
|
|
11
|
0
|
22
|
my ($self) = @_; |
2098
|
|
|
|
|
|
|
|
2099
|
3
|
|
|
|
|
9
|
my ($error, $result) = $self->catch('data', 'project'); |
2100
|
|
|
|
|
|
|
|
2101
|
3
|
|
|
|
|
20
|
my $output = []; |
2102
|
|
|
|
|
|
|
|
2103
|
3
|
50
|
|
|
|
19
|
if (!$error) { |
2104
|
2
|
|
|
|
|
10
|
push @$output, $result; |
2105
|
|
|
|
|
|
|
} |
2106
|
|
|
|
|
|
|
|
2107
|
3
|
|
|
|
|
113
|
return $output; |
2108
|
|
|
|
|
|
|
} |
2109
|
|
|
|
|
|
|
|
2110
|
|
|
|
|
|
|
sub text_for_signature { |
2111
|
8
|
|
|
16
|
0
|
29
|
my ($self, $name) = @_; |
2112
|
|
|
|
|
|
|
|
2113
|
8
|
|
|
|
|
24
|
my ($error, $result) = $self->catch('data', 'signature', $name); |
2114
|
|
|
|
|
|
|
|
2115
|
8
|
|
|
|
|
32
|
my $output = []; |
2116
|
|
|
|
|
|
|
|
2117
|
8
|
50
|
|
|
|
38
|
if (!$error) { |
2118
|
8
|
|
|
|
|
25
|
push @$output, $result; |
2119
|
|
|
|
|
|
|
} |
2120
|
|
|
|
|
|
|
|
2121
|
8
|
|
|
|
|
117
|
return $output; |
2122
|
|
|
|
|
|
|
} |
2123
|
|
|
|
|
|
|
|
2124
|
|
|
|
|
|
|
sub text_for_synopsis { |
2125
|
4
|
|
|
12
|
0
|
21
|
my ($self) = @_; |
2126
|
|
|
|
|
|
|
|
2127
|
4
|
|
|
|
|
14
|
my ($error, $result) = $self->catch('data', 'synopsis'); |
2128
|
|
|
|
|
|
|
|
2129
|
4
|
|
|
|
|
21
|
my $output = []; |
2130
|
|
|
|
|
|
|
|
2131
|
4
|
50
|
|
|
|
24
|
if (!$error) { |
2132
|
4
|
|
|
|
|
12
|
push @$output, $result; |
2133
|
|
|
|
|
|
|
} |
2134
|
|
|
|
|
|
|
|
2135
|
4
|
|
|
|
|
119
|
return $output; |
2136
|
|
|
|
|
|
|
} |
2137
|
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
|
sub text_for_tagline { |
2139
|
4
|
|
|
12
|
0
|
19
|
my ($self) = @_; |
2140
|
|
|
|
|
|
|
|
2141
|
4
|
|
|
|
|
11
|
my ($error, $result) = $self->catch('data', 'tagline'); |
2142
|
|
|
|
|
|
|
|
2143
|
4
|
|
|
|
|
19
|
my $output = []; |
2144
|
|
|
|
|
|
|
|
2145
|
4
|
50
|
|
|
|
22
|
if (!$error) { |
2146
|
4
|
|
|
|
|
15
|
push @$output, $result; |
2147
|
|
|
|
|
|
|
} |
2148
|
|
|
|
|
|
|
|
2149
|
4
|
|
|
|
|
132
|
return $output; |
2150
|
|
|
|
|
|
|
} |
2151
|
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
|
sub text_for_version { |
2153
|
3
|
|
|
11
|
0
|
16
|
my ($self) = @_; |
2154
|
|
|
|
|
|
|
|
2155
|
3
|
|
|
|
|
9
|
my ($error, $result) = $self->catch('data', 'version'); |
2156
|
|
|
|
|
|
|
|
2157
|
3
|
|
|
|
|
32
|
my $output = []; |
2158
|
|
|
|
|
|
|
|
2159
|
3
|
50
|
|
|
|
33
|
if (!$error) { |
2160
|
2
|
|
|
|
|
7
|
push @$output, $result; |
2161
|
|
|
|
|
|
|
} |
2162
|
|
|
|
|
|
|
|
2163
|
3
|
50
|
|
|
|
123
|
if (!@$output) { |
2164
|
3
|
|
|
|
|
24
|
my $name = $self->text_for_name; |
2165
|
3
|
50
|
|
|
|
34
|
if (my $version = ($name->[0] =~ m/([:\w]+)/m)[0]->VERSION) { |
2166
|
2
|
|
|
|
|
16
|
push @$output, $version; |
2167
|
|
|
|
|
|
|
} |
2168
|
|
|
|
|
|
|
} |
2169
|
|
|
|
|
|
|
|
2170
|
3
|
|
|
|
|
25
|
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 |