()
| 2313 | |
| 2314 | #[test] |
| 2315 | fn round_trip_preserves_multi_port() { |
| 2316 | let yaml = r" |
| 2317 | version: 1 |
| 2318 | network_policies: |
| 2319 | test: |
| 2320 | name: test |
| 2321 | endpoints: |
| 2322 | - host: api.example.com |
| 2323 | ports: |
| 2324 | - 80 |
| 2325 | - 443 |
| 2326 | binaries: |
| 2327 | - { path: /usr/bin/curl } |
| 2328 | "; |
| 2329 | let proto1 = parse_sandbox_policy(yaml).expect("parse failed"); |
| 2330 | let yaml_out = serialize_sandbox_policy(&proto1).expect("serialize failed"); |
| 2331 | let proto2 = parse_sandbox_policy(&yaml_out).expect("re-parse failed"); |
| 2332 | |
| 2333 | let ep1 = &proto1.network_policies["test"].endpoints[0]; |
| 2334 | let ep2 = &proto2.network_policies["test"].endpoints[0]; |
| 2335 | assert_eq!(ep1.ports, ep2.ports); |
| 2336 | assert_eq!(ep1.ports, vec![80, 443]); |
| 2337 | } |
| 2338 | |
| 2339 | #[test] |
| 2340 | fn serialize_single_port_uses_compact_form() { |
nothing calls this directly
no test coverage detected