line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::Core::Assertions::Match; |
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
4
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
59
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
113
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/assert_match/; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Test::Chai::Util::Flag qw/flag/; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
306
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub assert_match { |
12
|
6
|
|
|
6
|
0
|
8
|
my ($self, $re, $msg) = @_; |
13
|
|
|
|
|
|
|
|
14
|
6
|
50
|
|
|
|
16
|
flag($self, 'message', $msg) if defined $msg; |
15
|
6
|
|
|
|
|
14
|
my $obj = flag($self, 'object'); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return $self->assert( |
18
|
6
|
|
|
|
|
9
|
@{[ $obj =~ /$re/ ]} > 0, |
|
6
|
|
|
|
|
49
|
|
19
|
|
|
|
|
|
|
'expected #{this} to match ' . $re, |
20
|
|
|
|
|
|
|
'expected #{this} not to match ' . $re |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |