line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package OOP::Perlish::Class::Accessor::UnitTests::Regex; |
3
|
1
|
|
|
1
|
|
6
|
use OOP::Perlish::Class::Accessor::UnitTests::Base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
6
|
use base qw(OOP::Perlish::Class::Accessor::UnitTests::Base); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
83
|
|
5
|
1
|
|
|
1
|
|
6
|
use OOP::Perlish::Class::Accessor; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
5
|
use Test::More; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub setup : Test(setup) |
9
|
|
|
|
|
|
|
{ |
10
|
3
|
|
|
3
|
0
|
2596
|
my ($self) = @_; |
11
|
3
|
|
|
|
|
39
|
$self->{accessor} = OOP::Perlish::Class::Accessor->new( type => 'REGEXP', name => 'test', self => bless({}, __PACKAGE__) ); |
12
|
1
|
|
|
1
|
|
358
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub set_value : Test |
15
|
|
|
|
|
|
|
{ |
16
|
1
|
|
|
1
|
0
|
182
|
my ($self) = @_; |
17
|
1
|
|
|
|
|
7
|
my $regex_re = qr/foo/; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
8
|
$self->{accessor}->value( $regex_re ); |
20
|
1
|
|
|
|
|
10
|
is( $self->{accessor}->value(), $regex_re, 'can set regex_re' ); |
21
|
1
|
|
|
1
|
|
377
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub negative_set_value : Test |
24
|
|
|
|
|
|
|
{ |
25
|
1
|
|
|
1
|
0
|
190
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
1
|
|
|
|
|
3
|
my $regex_re = 'foo'; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
|
|
8
|
$self->{accessor}->value( $regex_re ); |
30
|
1
|
|
|
|
|
8
|
ok( ! $self->{accessor}->value(), 'negative assert: cannot set non-regex_re' ); |
31
|
1
|
|
|
1
|
|
278
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub returned_regex_re_executable : Test |
34
|
|
|
|
|
|
|
{ |
35
|
1
|
|
|
1
|
0
|
177
|
my ($self) = @_; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
8
|
my $regex_re = qr/foo/; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
8
|
$self->{accessor}->value( $regex_re ); |
40
|
1
|
|
|
|
|
11
|
ok( 'foo' =~ $self->{accessor}->value(), 'can set regex_re' ); |
41
|
1
|
|
|
1
|
|
315
|
} |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
=head1 NAME |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 METHODS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Jamie Beverly, C<< >> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 BUGS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, |
59
|
|
|
|
|
|
|
or through |
60
|
|
|
|
|
|
|
the web interface at |
61
|
|
|
|
|
|
|
L. I will be |
62
|
|
|
|
|
|
|
notified, and then you'll |
63
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SUPPORT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
perldoc OOP::Perlish::Class |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
You can also look for information at: |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
L |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=item * CPAN Ratings |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * Search CPAN |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
L |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=back |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Copyright 2009 Jamie Beverly |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
102
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
103
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |