()
| 453 | |
| 454 | #[test] |
| 455 | fn binary_data() { |
| 456 | // Binary data with no patterns — should still roundtrip (escape every byte). |
| 457 | let data: Vec<&[u8]> = vec![&[0, 1, 2, 3, 4, 255, 254, 253]]; |
| 458 | let encoded = encode(&data); |
| 459 | let decoded = decode(&encoded).unwrap(); |
| 460 | assert_eq!(decoded[0], data[0]); |
| 461 | } |
| 462 | |
| 463 | #[test] |
| 464 | fn empty_strings() { |