test_binrw_write

Macro test_binrw_write 

Source
macro_rules! test_binrw_write {
    (
        struct $name:ident $(=> $suffix:ident)? {
            $(
                $field:ident : $value:expr,
            )*
        } => $byte_arr_or_hex_stream:tt
    ) => { ... };
    (
        $type:ty: $value_expr:expr => $byte_arr_or_hex_stream:tt
    ) => { ... };
    (
        $type:ty => $suffix:ident: $value_expr:expr => $byte_arr_or_hex_stream:tt
    ) => { ... };
}
Expand description

BinWrite test macro.

Creates a test

test_binrw_write! {
    struct StructName {
        field1: value1,
        field2: value2,
        // ...
    }: [byte1, byte2, byte3, ...]
}