()
| 73 | |
| 74 | #[test] |
| 75 | fn framing_round_trip() { |
| 76 | let payload = b"hello world"; |
| 77 | let mut buf = Vec::new(); |
| 78 | let n = BlockFraming::encode(payload, &mut buf); |
| 79 | assert_eq!(n, FRAMING_OVERHEAD + payload.len()); |
| 80 | let (got, total) = BlockFraming::decode(&buf).unwrap(); |
| 81 | assert_eq!(got, payload); |
| 82 | assert_eq!(total, n); |
| 83 | } |
| 84 | |
| 85 | #[test] |
| 86 | fn framing_round_trip_empty() { |