(
bytes: impl Into<Bytes>,
expected: &T::Error,
context: T::Context,
)
| 108 | |
| 109 | #[track_caller] |
| 110 | pub(crate) fn assert_decode_error<T>( |
| 111 | bytes: impl Into<Bytes>, |
| 112 | expected: &T::Error, |
| 113 | context: T::Context, |
| 114 | ) where |
| 115 | T: Decode + Debug, |
| 116 | T::Error: PartialEq, |
| 117 | { |
| 118 | let mut bytes = bytes.into(); |
| 119 | let mut buffer = Buffer::new(&mut bytes); |
| 120 | |
| 121 | let result = T::decode(&mut buffer, context).expect_err("should fail to encode"); |
| 122 | |
| 123 | let context = result.current_context(); |
| 124 | |
| 125 | assert_eq!(*context, *expected); |
| 126 | } |
| 127 | |
| 128 | #[track_caller] |
| 129 | pub(crate) fn assert_codec<T>(value: &T, context: T::Context) |
nothing calls this directly
no test coverage detected