()
| 84 | |
| 85 | #[test] |
| 86 | fn framing_round_trip_empty() { |
| 87 | let mut buf = Vec::new(); |
| 88 | BlockFraming::encode(&[], &mut buf); |
| 89 | let (got, total) = BlockFraming::decode(&buf).unwrap(); |
| 90 | assert_eq!(got, &[] as &[u8]); |
| 91 | assert_eq!(total, FRAMING_OVERHEAD); |
| 92 | } |
| 93 | |
| 94 | #[test] |
| 95 | fn framing_rejects_truncated_header() { |