line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Chai::Core::Assertions::String; |
2
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
50
|
|
4
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
10
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
57
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
113
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/assert_string/; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Test::Chai::Util::Flag qw/flag/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
99
|
|
10
|
2
|
|
|
2
|
|
9
|
use Test::Chai::Util::Inspect qw/inspect/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
354
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub assert_string { |
13
|
6
|
|
|
6
|
0
|
14
|
my ($self, $str, $msg) = @_; |
14
|
|
|
|
|
|
|
|
15
|
6
|
50
|
|
|
|
15
|
flag($self, 'message', $msg) if defined $msg; |
16
|
6
|
|
|
|
|
19
|
my $obj = flag($self, 'object'); |
17
|
|
|
|
|
|
|
|
18
|
6
|
|
|
|
|
25
|
ref($self)->new($obj, $msg)->is->a('Str'); |
19
|
|
|
|
|
|
|
|
20
|
6
|
|
|
|
|
45
|
return $self->assert( |
21
|
|
|
|
|
|
|
index($obj, $str) > -1, |
22
|
|
|
|
|
|
|
'expected #{this} to contain ' . inspect($str), |
23
|
|
|
|
|
|
|
'expected #{this} to not contain ' . inspect($str) |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |