I noticed the issue after adding Oj serializer and trying to use Marshal. Instead of original object it would return a string. Turns out serializer couldn't be detected. That's because it would do 1 & 4 in rassoc which is 0. Original implementation works for 3 = "11", and 4="100" works for 4 but cuts off everything below. Instead we should extract first 3 bytes (7 = "111") from passed integer regardless of serializers array length.
Thanks @epilgrim for helping me out with this one.
Coverage remained the same at 100.0% when pulling 4e8f9d09ba8c366f24fb37d7b8387ba97c233bf0 on kagux:fix/serializer_decompose into 553d45273d179ece53c723cb9b4a827a0c378d5b on sorentwo:master.
I noticed the issue after adding Oj serializer and trying to use Marshal. Instead of original object it would return a string. Turns out serializer couldn't be detected. That's because it would do
1 & 4
inrassoc
which is0
. Original implementation works for3 = "11"
, and4="100"
works for 4 but cuts off everything below. Instead we should extract first 3 bytes (7 = "111") from passed integer regardless of serializers array length. Thanks @epilgrim for helping me out with this one.