Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using integer keys causes get/set to not work as expected #157

Closed
okhwaja opened this issue Jan 28, 2019 · 2 comments
Closed

Using integer keys causes get/set to not work as expected #157

okhwaja opened this issue Jan 28, 2019 · 2 comments
Labels

Comments

@okhwaja
Copy link
Contributor

okhwaja commented Jan 28, 2019

Hi,

I'm running into an issue when using a SET followed by a GET with integer keys. My productionredis-rb client handles this case.

[1] pry(main)> r = Redis.new;
[2] pry(main)> r.set(123, 'yo')
  Redis (3.30ms) SET 123 yo
=> "OK"
[3] pry(main)> r.get(123)
  Redis (0.65ms) GET 123
=> "yo"
[4] pry(main)> m = MockRedis.new;
[5] pry(main)> m.set(123, 'yo')
=> "OK"
[6] pry(main)> m.get(123)
=> nil

The key is converted into a string in the SET method, but not in the GET method

I'd be happy to submit a PR to change this behavior. Please let me know

@sds
Copy link
Owner

sds commented Jan 29, 2019

Thanks for the report, @okhwaja. Would love a pull request to make this consistent. Should be easy to add a test for, as well.

@sds
Copy link
Owner

sds commented Jan 30, 2019

Fixed in #158. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants