-
Notifications
You must be signed in to change notification settings - Fork 59
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
Bitmaps not interchangeable with strings #520
Comments
Hey @newacct , first of all, enormous thank you for submitting all the bugs for JedisMock! This one is a known limitation, as in order to hold a value which is modified by In Java's Could you clarify if you have a real-life use-case for this or is this just a random finding of yours? |
We are thinking of maybe using jedis-mock in place of Redis for our unit tests once all the bugs have been ironed out, but we would disable it for unit tests that use unsupported features. There is one place in the code that tests setting bits and getting the whole bitmap out to parse, but if this is a known limitation, then that's fine; we'll just not use jedis-mock for that. |
Got it. Yes it's a limitation, but not an unsurmountable one. I just thought that there are no real-world scenarios when you would like to set bits and then read the result as a meaningful string (reading it as a "data dump" which can be stored later somwhere else is supported). But yeah, as soon as there's evidence that people are doing this, we're going to fix it, although this will take a couple of months maybe. The fix for |
Fixed in 1.1.6 |
The documentation page for SETBIT has an example:
which should produce the string
42
, but it instead produces[��sr1com.github.fppt.jedismock.datastructures.RMBitMapIsizeLbitSettLjava/util/BitSet;xr9com.github.fppt.jedismock.datastructures.StringCompatible0����psrjava.util.BitSetn��~94�![bitst[Jxpur[Jx ��u�xpL,x]
Also, when you set a string and then get the bits, it produces the wrong result:
should produce 0 (bit 0 is the most significant bit, not the least significant bit), but produces 1.
The text was updated successfully, but these errors were encountered: