btree_network/error/
test.rs

1#[cfg(test)]
2mod unit_tests {
3    #[cfg(any(feature = "serde_json", feature = "serde_yaml", feature = "serde_cbor"))]
4    use crate::error::{EncodingError, Error};
5
6    #[test]
7    #[cfg(all(feature = "serde", feature = "serde_cbor"))]
8    fn test_from_cbor_encoding_error() {
9        assert_eq!(
10            Error::EncodingError(EncodingError::CborError),
11            EncodingError::CborError.into()
12        );
13    }
14
15    #[test]
16    #[cfg(all(feature = "serde", feature = "serde_json"))]
17    fn test_from_json_encoding_error() {
18        assert_eq!(
19            Error::EncodingError(EncodingError::JsonError),
20            EncodingError::JsonError.into()
21        );
22    }
23
24    #[test]
25    #[cfg(all(feature = "serde", feature = "serde_yaml"))]
26    fn test_from_yaml_encoding_error() {
27        assert_eq!(
28            Error::EncodingError(EncodingError::YamlError),
29            EncodingError::YamlError.into()
30        );
31    }
32}