Open notak opened 8 years ago
I believe this won't work as expected. The current lpush adds to the end of the list and lpop removes from the end of the list. To make the rpush and rpop work a) modifications will have to be made to the lpush and lpop methods to add to the start of the list and remove from the start of the list. b) rpush should add to the end of the list and remove should get an index of list.size() - 1
It would be sensible to do that if you wanted to implement lrange. As it is this works just fine for lpush/lpop/rpush/rpop and I was just aiming for a minimal change set. The project seems to be dead anyway
lrange is already implemented in the library, its just not mentioned in the documentation. And yeah, this project is dead, I wonder why... I am sure people still need to mock jedis for their testing.
I forked a repo and maintain it on the maven central for the rpush/rpop features. Please see https://github.com/xuanyue202/mock-jedis
Thanks @xuanyue202 for resurrecting the project. Curious if you plan on actively maintaining your fork going forward?
Didn't notice the PR from last year to do the same thing. I think from testing that this one implements the correct ordering on pushing multiple elements.