Subject: | Rename does not remove original key |
Here's a sample that does not work as expected:
perl -we 'use Test::Mock::Redis; my $red = Test::Mock::Redis->new();
$red->set("foo", 1)
; $red->rename("foo", "bar"); print join ",", $red->keys; '
would print "foo,bar" instead of just "bar". I wrote a patch to fix it.
Subject: | test-mock-redis.patch |
--- /usr/local/lib/perl5/site_perl/5.10.1/Test/Mock/Redis.pm 2011-07-14 11:20:41.000000000 +0400
+++ - 2011-10-05 11:38:28.021099338 +0400
@@ -337,6 +337,7 @@
confess 'rename to existing key' if $whine && $self->_stash->{$to};
$self->_stash->{$to} = $self->_stash->{$from};
+ delete $self->_stash->{$from};
return 1;
}