line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Class::Moose::Util; |
2
|
|
|
|
|
|
|
|
3
|
29
|
|
|
29
|
|
237
|
use strict; |
|
29
|
|
|
|
|
60
|
|
|
29
|
|
|
|
|
929
|
|
4
|
29
|
|
|
29
|
|
156
|
use warnings; |
|
29
|
|
|
|
|
61
|
|
|
29
|
|
|
|
|
1415
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.97'; |
7
|
|
|
|
|
|
|
|
8
|
29
|
|
|
29
|
|
159
|
use Test2::API qw( context ); |
|
29
|
|
|
|
|
61
|
|
|
29
|
|
|
|
|
1724
|
|
9
|
|
|
|
|
|
|
|
10
|
29
|
|
|
29
|
|
153
|
use Exporter qw( import ); |
|
29
|
|
|
|
|
62
|
|
|
29
|
|
|
|
|
4924
|
|
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
|
530
|
|
|
530
|
0
|
1029
|
my $code = shift; |
18
|
530
|
|
|
|
|
919
|
my @args = @_; |
19
|
|
|
|
|
|
|
|
20
|
530
|
|
|
|
|
3089
|
my $ctx = context( level => 0 ); |
21
|
|
|
|
|
|
|
|
22
|
530
|
|
|
|
|
59087
|
my $want = wantarray; |
23
|
|
|
|
|
|
|
|
24
|
530
|
|
|
|
|
803
|
my @out; |
25
|
530
|
|
|
|
|
877
|
my $ok = eval { |
26
|
530
|
100
|
|
|
|
2319
|
$want ? @out |
|
|
50
|
|
|
|
|
|
27
|
|
|
|
|
|
|
= $code->( $ctx, @args ) |
28
|
|
|
|
|
|
|
: defined($want) ? $out[0] |
29
|
|
|
|
|
|
|
= $code->( $ctx, @args ) |
30
|
|
|
|
|
|
|
: $code->( $ctx, @args ); |
31
|
520
|
|
|
|
|
10324
|
1; |
32
|
|
|
|
|
|
|
}; |
33
|
520
|
|
|
|
|
824
|
my $err = $@; |
34
|
|
|
|
|
|
|
|
35
|
520
|
|
|
|
|
1795
|
$ctx->release; |
36
|
|
|
|
|
|
|
|
37
|
520
|
50
|
|
|
|
6042
|
die $err unless $ok; |
38
|
|
|
|
|
|
|
|
39
|
520
|
50
|
|
|
|
1039
|
return @out if $want; |
40
|
520
|
100
|
|
|
|
1768
|
return $out[0] if defined $want; |
41
|
177
|
|
|
|
|
563
|
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.97 |
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 |