| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Test::Stream::Compare::String; | 
| 2 | 100 |  |  | 100 |  | 1041 | use strict; | 
|  | 100 |  |  |  |  | 198 |  | 
|  | 100 |  |  |  |  | 2548 |  | 
| 3 | 100 |  |  | 100 |  | 512 | use warnings; | 
|  | 100 |  |  |  |  | 183 |  | 
|  | 100 |  |  |  |  | 2710 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 100 |  |  | 100 |  | 726 | use Carp qw/confess/; | 
|  | 100 |  |  |  |  | 195 |  | 
|  | 100 |  |  |  |  | 4377 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 100 |  |  | 100 |  | 527 | use Test::Stream::Compare; | 
|  | 100 |  |  |  |  | 181 |  | 
|  | 100 |  |  |  |  | 645 |  | 
| 8 |  |  |  |  |  |  | use Test::Stream::HashBase( | 
| 9 | 100 |  |  |  |  | 815 | base => 'Test::Stream::Compare', | 
| 10 |  |  |  |  |  |  | accessors => [qw/input negate/], | 
| 11 | 100 |  |  | 100 |  | 535 | ); | 
|  | 100 |  |  |  |  | 212 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 55 |  |  | 55 | 0 | 203 | sub stringify_got { 1 } | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | sub init { | 
| 16 | 3874 |  |  | 3874 | 0 | 5420 | my $self = shift; | 
| 17 |  |  |  |  |  |  | confess "input must be defined for 'String' check" | 
| 18 | 3874 | 100 |  |  |  | 9321 | unless defined $self->{+INPUT}; | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 3873 |  |  |  |  | 11509 | $self->SUPER::init(@_); | 
| 21 |  |  |  |  |  |  | } | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | sub name { | 
| 24 | 72 |  |  | 72 | 1 | 98 | my $self = shift; | 
| 25 | 72 |  |  |  |  | 112 | my $in = $self->{+INPUT}; | 
| 26 | 72 |  |  |  |  | 268 | return "$in"; | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | sub operator { | 
| 30 | 85 |  |  | 85 | 1 | 131 | my $self = shift; | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 85 | 100 |  |  |  | 221 | return '' unless @_; | 
| 33 | 72 |  |  |  |  | 126 | my ($got) = @_; | 
| 34 |  |  |  |  |  |  |  | 
| 35 | 72 | 100 |  |  |  | 176 | return '' unless defined($got); | 
| 36 |  |  |  |  |  |  |  | 
| 37 | 65 | 100 |  |  |  | 169 | return 'ne' if $self->{+NEGATE}; | 
| 38 | 63 |  |  |  |  | 201 | return 'eq'; | 
| 39 |  |  |  |  |  |  | } | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | sub verify { | 
| 42 | 3870 |  |  | 3870 | 1 | 5275 | my $self = shift; | 
| 43 | 3870 |  |  |  |  | 11862 | my %params = @_; | 
| 44 | 3870 |  |  |  |  | 7633 | my ($got, $exists) = @params{qw/got exists/}; | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 3870 | 100 |  |  |  | 7572 | return 0 unless $exists; | 
| 47 | 3853 | 100 |  |  |  | 7578 | return 0 unless defined $got; | 
| 48 |  |  |  |  |  |  |  | 
| 49 | 3843 |  |  |  |  | 5829 | my $input  = $self->{+INPUT}; | 
| 50 | 3843 |  |  |  |  | 5255 | my $negate = $self->{+NEGATE}; | 
| 51 |  |  |  |  |  |  |  | 
| 52 | 3843 | 100 |  |  |  | 7359 | return "$input" ne "$got" if $negate; | 
| 53 | 3837 |  |  |  |  | 16753 | return "$input" eq "$got"; | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | 1; | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | __END__ |