()
| 86 | |
| 87 | #[test] |
| 88 | fn roundtrip() { |
| 89 | let payload: Vec<i32> = vec![1, -2, 3, -4]; |
| 90 | let bytes = encode(MAGIC, 7, &payload).unwrap(); |
| 91 | let restored: Vec<i32> = decode(MAGIC, 7, &bytes).unwrap(); |
| 92 | assert_eq!(restored, payload); |
| 93 | } |
| 94 | |
| 95 | #[test] |
| 96 | fn rejects_short_buffer() { |