| 436 | |
| 437 | #[test] |
| 438 | fn hostnames() { |
| 439 | let hosts: Vec<&[u8]> = vec![ |
| 440 | b"prod-web-01.us-east-1.example.com", |
| 441 | b"prod-web-02.us-east-1.example.com", |
| 442 | b"prod-web-03.us-east-1.example.com", |
| 443 | b"prod-api-01.us-west-2.example.com", |
| 444 | b"prod-api-02.us-west-2.example.com", |
| 445 | b"staging-web-01.eu-west-1.example.com", |
| 446 | ]; |
| 447 | let encoded = encode(&hosts); |
| 448 | let decoded = decode(&encoded).unwrap(); |
| 449 | for (a, b) in hosts.iter().zip(decoded.iter()) { |
| 450 | assert_eq!(*a, b.as_slice()); |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | #[test] |
| 455 | fn binary_data() { |