BedrockStreaming / RedisMock

A simple PHP Redis mock
http://tech.m6web.fr/redismock-qui-a-bouchonne-mon-redis.html
MIT License
81 stars 59 forks source link

Redis zadd scores are not always integer #86

Closed magnetik closed 5 years ago

magnetik commented 5 years ago

From redis documentation

Redis sorted sets use a double 64-bit floating point number to represent the score.

Not sure if this is a BC break since the library used to allow anything an automatically cast it.

omansour commented 5 years ago

why not

magnetik commented 5 years ago

Yeah this is indeed a good idea. I've pushed a fixed version.

magnetik commented 5 years ago

And #87 is somewhat linked to this as the score is always returned as string in redis.

b-viguier commented 5 years ago

And what about a unit test?

Is it possible to add a test for this behavior? Checking that values 1, 1.1 and "1.1" are ok, but not "this is not a number"?

magnetik commented 5 years ago

I've added test

omansour commented 5 years ago

not sure about the version number we should use for this release

b-viguier commented 5 years ago

@omansour could be considered as bugfix IMHO (and bundled with #87). No new feature, no feature change… previous version has a very tricky/weird behavior with not numeric values, now we throw an exception to prevent this bad usage.

magnetik commented 5 years ago

Many thanks 👌