| package Test::Deep::Cache; |
| use Test::Deep::Cache::Simple; |
| my $self = bless {}, $pkg; |
| $self->{expects} = [Test::Deep::Cache::Simple->new]; |
| $self->{normal} = [Test::Deep::Cache::Simple->new]; |
| $self->{$type}->[-1]->add(@_); |
| # go through all the caches to see if we know this one |
| foreach my $cache (@{$self->{$type}}) |
| return 1 if $cache->cmp(@_); |
| foreach my $type (qw( expects normal )) |
| push(@{$self->{$type}}, Test::Deep::Cache::Simple->new); |
| foreach my $type (qw( expects normal )) |
| my $caches = $self->{$type}; |
| $caches->[-1]->absorb($last) if $keep; |
| return $Test::Deep::Expects ? "expects" : "normal"; |