Skip to content

Incorrect decoding of 128u8 #10

@noib3

Description

@noib3
#[test]
fn decode_128() {
    let (buf, len) = varint_simd::encode(128u8);
    assert_eq!(&buf[..len as usize], [128, 1]);

    // 💥 should ask for more bytes, instead returns Ok((0, 2)).
    assert!(matches!(
        varint_simd::decode::<u8>(&buf[..1]),
        Err(varint_simd::VarIntDecodeError::NotEnoughBytes)
    ));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions