line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Class::Moose::Util; |
2
|
|
|
|
|
|
|
|
3
|
30
|
|
|
30
|
|
213
|
use strict; |
|
30
|
|
|
|
|
136
|
|
|
30
|
|
|
|
|
914
|
|
4
|
30
|
|
|
30
|
|
150
|
use warnings; |
|
30
|
|
|
|
|
58
|
|
|
30
|
|
|
|
|
1325
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.98'; |
7
|
|
|
|
|
|
|
|
8
|
30
|
|
|
30
|
|
184
|
use Test2::API qw( context ); |
|
30
|
|
|
|
|
60
|
|
|
30
|
|
|
|
|
1757
|
|
9
|
|
|
|
|
|
|
|
10
|
30
|
|
|
30
|
|
282
|
use Exporter qw( import ); |
|
30
|
|
|
|
|
53
|
|
|
30
|
|
|
|
|
5818
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT_OK = qw( context_do ); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# This is identical to the version in Test2::API except we set level to 0 |
15
|
|
|
|
|
|
|
# rather than 1. |
16
|
|
|
|
|
|
|
sub context_do (&;@) { |
17
|
538
|
|
|
538
|
0
|
1191
|
my $code = shift; |
18
|
538
|
|
|
|
|
1039
|
my @args = @_; |
19
|
|
|
|
|
|
|
|
20
|
538
|
|
|
|
|
2994
|
my $ctx = context( level => 0 ); |
21
|
|
|
|
|
|
|
|
22
|
538
|
|
|
|
|
81569
|
my $want = wantarray; |
23
|
|
|
|
|
|
|
|
24
|
538
|
|
|
|
|
861
|
my @out; |
25
|
538
|
|
|
|
|
924
|
my $ok = eval { |
26
|
538
|
100
|
|
|
|
3098
|
$want ? @out |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
= $code->( $ctx, @args ) |
28
|
|
|
|
|
|
|
: defined($want) ? $out[0] |
29
|
|
|
|
|
|
|
= $code->( $ctx, @args ) |
30
|
|
|
|
|
|
|
: $code->( $ctx, @args ); |
31
|
528
|
|
|
|
|
17352
|
1; |
32
|
|
|
|
|
|
|
}; |
33
|
528
|
|
|
|
|
896
|
my $err = $@; |
34
|
|
|
|
|
|
|
|
35
|
528
|
|
|
|
|
2140
|
$ctx->release; |
36
|
|
|
|
|
|
|
|
37
|
528
|
50
|
|
|
|
6656
|
die $err unless $ok; |
38
|
|
|
|
|
|
|
|
39
|
528
|
50
|
|
|
|
1020
|
return @out if $want; |
40
|
528
|
100
|
|
|
|
2275
|
return $out[0] if defined $want; |
41
|
180
|
|
|
|
|
534
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ABSTRACT: Internal utilities |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Test::Class::Moose::Util - Internal utilities |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 0.98 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=for Pod::Coverage context_do |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SUPPORT |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/test-class-moose/issues>. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SOURCE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The source code repository for Test-Class-Moose can be found at L<https://github.com/houseabsolute/test-class-moose>. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHORS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=over 4 |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item * |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Curtis "Ovid" Poe <ovid@cpan.org> |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item * |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This software is copyright (c) 2012 - 2019 by Curtis "Ovid" Poe. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
93
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
The full text of the license can be found in the |
96
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |