| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Test::Stream::Compare::String; | 
| 2 | 100 |  |  | 100 |  | 1049 | use strict; | 
|  | 100 |  |  |  |  | 204 |  | 
|  | 100 |  |  |  |  | 2707 |  | 
| 3 | 100 |  |  | 100 |  | 501 | use warnings; | 
|  | 100 |  |  |  |  | 189 |  | 
|  | 100 |  |  |  |  | 2725 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 100 |  |  | 100 |  | 483 | use Carp qw/confess/; | 
|  | 100 |  |  |  |  | 190 |  | 
|  | 100 |  |  |  |  | 4407 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 | 100 |  |  | 100 |  | 524 | use Test::Stream::Compare; | 
|  | 100 |  |  |  |  | 172 |  | 
|  | 100 |  |  |  |  | 695 |  | 
| 8 |  |  |  |  |  |  | use Test::Stream::HashBase( | 
| 9 | 100 |  |  |  |  | 798 | base => 'Test::Stream::Compare', | 
| 10 |  |  |  |  |  |  | accessors => [qw/input negate/], | 
| 11 | 100 |  |  | 100 |  | 574 | ); | 
|  | 100 |  |  |  |  | 181 |  | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 55 |  |  | 55 | 0 | 201 | sub stringify_got { 1 } | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | sub init { | 
| 16 | 3874 |  |  | 3874 | 0 | 5519 | my $self = shift; | 
| 17 |  |  |  |  |  |  | confess "input must be defined for 'String' check" | 
| 18 | 3874 | 100 |  |  |  | 9619 | unless defined $self->{+INPUT}; | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 3873 |  |  |  |  | 11713 | $self->SUPER::init(@_); | 
| 21 |  |  |  |  |  |  | } | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | sub name { | 
| 24 | 72 |  |  | 72 | 1 | 113 | my $self = shift; | 
| 25 | 72 |  |  |  |  | 122 | my $in = $self->{+INPUT}; | 
| 26 | 72 |  |  |  |  | 266 | return "$in"; | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | sub operator { | 
| 30 | 85 |  |  | 85 | 1 | 151 | my $self = shift; | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 85 | 100 |  |  |  | 299 | return '' unless @_; | 
| 33 | 72 |  |  |  |  | 112 | my ($got) = @_; | 
| 34 |  |  |  |  |  |  |  | 
| 35 | 72 | 100 |  |  |  | 230 | return '' unless defined($got); | 
| 36 |  |  |  |  |  |  |  | 
| 37 | 65 | 100 |  |  |  | 215 | return 'ne' if $self->{+NEGATE}; | 
| 38 | 63 |  |  |  |  | 204 | return 'eq'; | 
| 39 |  |  |  |  |  |  | } | 
| 40 |  |  |  |  |  |  |  | 
| 41 |  |  |  |  |  |  | sub verify { | 
| 42 | 3870 |  |  | 3870 | 1 | 5424 | my $self = shift; | 
| 43 | 3870 |  |  |  |  | 12138 | my %params = @_; | 
| 44 | 3870 |  |  |  |  | 7635 | my ($got, $exists) = @params{qw/got exists/}; | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 3870 | 100 |  |  |  | 8024 | return 0 unless $exists; | 
| 47 | 3853 | 100 |  |  |  | 7712 | return 0 unless defined $got; | 
| 48 |  |  |  |  |  |  |  | 
| 49 | 3843 |  |  |  |  | 5904 | my $input  = $self->{+INPUT}; | 
| 50 | 3843 |  |  |  |  | 5404 | my $negate = $self->{+NEGATE}; | 
| 51 |  |  |  |  |  |  |  | 
| 52 | 3843 | 100 |  |  |  | 7588 | return "$input" ne "$got" if $negate; | 
| 53 | 3837 |  |  |  |  | 16955 | return "$input" eq "$got"; | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | 1; | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | __END__ |