Hey everyone, I have a test:
pub fn decode_fixstr_test() {
// Fixstr "ok" => tag 0xA2 (length 2), then ASCII for "o", "k"
<<0xA2, 111, 107>>
|> tap_inspect
|> m.msgpack_decode
|> should.equal(Ok(m.MsgString("ok")))
}
And, inside the msgpack_decode function, I have taps set to print:
pub fn msgpack_decode(bytes: BitArray) -> Result(MsgPack, String) {
let ins = "Raw bytes:" <> bit_array.inspect(bytes)
let size = "Bit Size: " <> int.to_string(bit_array.bit_size(bytes))
io.print(ins)
io.print(size)
case bit_array.slice(from: bytes, at: 0, take: 1) {
And inside, we see:
Raw bytes:<<217, 2, 111, 107>>
Bit Size: 32
But, I have the tap, and it prints:
<<162, 111, 107>>
How would the value possibly be mutated like that? I'm not touching it in the tap, and when I run inspect() on it again, we get <<217, 2, 111, 107>>. Any ideas anyone?