macro_rules! test_encoding_enum {
    ($enum:path as $ty:ty; $( $item:path => $val:expr ),+) => { ... };
    ($se:ident => $enum:path as $ty:ty; $( $item:path => $val:expr ),+) => { ... };
}
👎 Deprecated since 1.6.1:

use strict_encoding_test crate instead

Expand description

Macro testing encodings of all enum variants.

NB: If the enum has primitive assigned values, test_encoding_enum_by_values should be used instead if this macro. If primitive values are u8-based, please use test_encoding_enum_u8_exhaustive.

Macro expands into an expression of Result<(), EnumEncodingTestFailure> type.

Covered test case

  • Strict encoding must match little-endian encoding of the value
  • Roundtrip encoding-decoding of the enum variant must result in the original value