()
| 462 | |
| 463 | #[test] |
| 464 | fn empty_strings() { |
| 465 | let strings: Vec<&[u8]> = vec![b"", b"hello", b"", b"world", b""]; |
| 466 | let encoded = encode(&strings); |
| 467 | let decoded = decode(&encoded).unwrap(); |
| 468 | assert_eq!(decoded.len(), 5); |
| 469 | assert!(decoded[0].is_empty()); |
| 470 | assert_eq!(decoded[1], b"hello"); |
| 471 | assert!(decoded[2].is_empty()); |
| 472 | } |
| 473 | |
| 474 | #[test] |
| 475 | fn delimited_roundtrip() { |